No.892 Tapioca
タグ : / 解いたユーザー数 515
作問者 :
nmnmnmnmnmnmnm
/ テスター :
Problem Statement
There are 3 bottles of tapioca milk tea.
The $i$-th bottle of tapioca milk tea contains $A_i^{B_i}$ tapioca pearls.
Yuki and Taro want to take out all the tapioca pearls and divide them equally between the 2 of them.
Determine whether they can be divided equally.
* The appearance of the tapioca pearls is important. Do not cut them; always divide them in units of 1 pearl.
Input
$A_1$ $B_1$ $A_2$ $B_2$ $A_3$ $B_3$
$A_i$ and $B_i$ are both positive integers. $1 \le A_i,B_i \le 1000000000=10^9$.
Output
Print ":-)" if they can be divided equally, and ":-(" if they cannot.
Print a newline at the end.
Sample
Sample 1
Input
2 1 2 1 2 2
Output
:-)
$2^1$+$2^1$+$2^2$=8 tapioca pearls can be taken out.
They can be divided into 4 and 4 pearls, which is equal.
Sample 2
Input
1 1 1 1 1 1
Output
:-(
$1^1$+$1^1$+$1^1$=3 tapioca pearls can be taken out.
They can be divided into 1 and 2 pearls, but this is not equal.
Sample 3
Input
68 7 28 31 34 10
Output
:-)
$68^7$+$28^{31}$+$34^{10}$=727610523382138084983196530619930927544058880 tapioca pearls can be taken out.
They can be divided into 363805261691069042491598265309965463772029440 and 363805261691069042491598265309965463772029440 pearls, which is equal.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。