#codefestival2017qualcb. [code_festival_2017_qualc_b]Similar Arrays
[code_festival_2017_qualc_b]Similar Arrays
Problem Statement
We will say that two integer sequences of length , and , are similar when holds for all ().
In particular, any integer sequence is similar to itself.
You are given an integer and an integer sequence of length , .
How many integer sequences are there such that is similar to and the product of all elements, , is even?
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the number of integer sequences that satisfy the condition.
Sample Input 1
2
2 3
Sample Output 1
7
There are seven integer sequences that satisfy the condition:
Sample Input 2
3
3 3 3
Sample Output 2
26
Sample Input 3
1
100
Sample Output 3
1
Sample Input 4
10
90 52 56 71 44 8 13 30 57 84
Sample Output 4
58921