406310: GYM102354 A Square Root Partitioning
Memory Limit:0 MB
Time Limit:3 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
A. Square Root Partitioningtime limit per test3 secondsmemory limit per test256 mebibytesinputstandard inputoutputstandard output
Consider the following expression: $$$$$$\sqrt{a_1} \pm \sqrt{a_2} \pm \dots \pm \sqrt{a_n} = 0\text{.}$$$$$$ Calculate the number of ways to replace each $$$\pm$$$ with $$$+$$$ or $$$-$$$ so that it holds true.
InputThe first line of input contains a single integer $$$n$$$ ($$$2 \leq n \leq 36$$$).
Second line of input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \leq a_i \leq 10^{10^5}$$$).
OutputOutput a single integer: the answer to the problem.
ExamplesInput3 2 2 8Output
1Input
4 4 9 25 49Output
0