問題一覧 > 通常問題

No.1893 Cycle

レベル : / AI推定難易度 : 109 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 279
作問者 : Shirotsume / テスター : 👑 箱星 ygussany
お気に入りにしたユーザー ProblemId : 7458 / 自分の提出
問題文最終更新日: 2022-07-20 02:07:15
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 338 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。