Description
soda has a set
with
integers
. A set is called key set if the sum of integers in the set is an even number. He wants to know how many nonempty subsets of
are key set.
Input
There are multiple test cases. The first line of input contains an integer
, indicating the number of test cases. For each test case:
The first line contains an integer , the number of integers in the set.
The first line contains an integer , the number of integers in the set.
Output
For each test case, output the number of key sets modulo 1000000007.
Sample Input
4 1 2 3 4
Sample Output
0 1 3 7
#include<stdio.h>
__int64 quickpow(__int64 a,__int64 b,__int64 c){
__int64 tmp=a,res=1;
while(b)
{
if(b&1)
{
res*=tmp;
res%=c;
}
tmp*=tmp;
tmp%=c;
b>>=1;
}
return res;
}
int main()
{
__int64 n;
int t;
scanf("%d",&t);
while(t--)
{
scanf("%I64d",&n);
printf("%d\n",quickpow(2,n-1,1000000007)-1);
}
return 0;
}