No.1893 Cycle
タグ : / 解いたユーザー数 279
作問者 :
Problem Statement
As shown in the figure below, there are $12$ points placed at equal intervals on a circle. The points are numbered $0, 1, 2, \dots, 11$ in clockwise order.
Shirotsume chose $3$ distinct points $X, Y, Z$ from among these points and connected each pair with a line segment to form an equilateral triangle.
Given $X, Y$, find $Z$.
Constraints
- All input values are integers.
- $0 \leq X \leq 11$
- $0 \leq Y \leq 11$
- $X \neq Y$
- The input is guaranteed to be such that there exists a $Z$ for which the triangle formed by connecting points $X, Y, Z$ with line segments is an equilateral triangle.
Input
The input is given from standard input in the following format.
$X$ $Y$
Output
Output the integer $Z$ $(0 \leq Z \leq 11)$ that is the answer.
End the output with a newline.
Sample
Sample 1
Input
0 4
Output
8
Taking $(X, Y, Z) = (0, 4, 8)$ forms an equilateral triangle, as shown in the figure below.
Sample 2
Input
11 7
Output
3
Taking $(X, Y, Z) = (11, 7, 3)$ forms an equilateral triangle, as shown in the figure below.
Sample 3
Input
6 10
Output
2
Taking $(X, Y, Z) = (6, 10, 2)$ forms an equilateral triangle, as shown in the figure below.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。