Polynomial

아직 제출이 없습니다시간 제한3초메모리 제한256 MB

문제

Given a polynomial PP with coefficients from 0,1\\{0, 1\\}, print the number of odd coefficients in its nn-th power.

입력

The first line contains an integer dd (1d201 \le d \le 20) --- the degree of the polynomial.

The second line contains d+1d+1 integers a_ia\_i (a_i0,1a\_i \in \\{0, 1\\}), denoting the coefficients of PP from lowest to greatest.

The third line contains an integer nn (1n10161 \le n \le 10^{16}).

출력

Print the answer to the problem in the only line.

힌트

In the first sample test P(x)3=1+3x+3x2+x3P(x)^3 = 1 + 3x + 3x^2 + x^3, having all 4 coefficients odd.