Count Modulo 2

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

문제

You are given KK distinct nonnegative integers A_1,A_2,,A_KA\_1,A\_2,\cdots,A\_K. Count the number of sequences of NN nonnegative integers a_1,a_2,,a_Na\_1,a\_2,\cdots,a\_N that satisfies all of the following conditions, modulo 22.

  • a_1+a_2++a_N=Sa\_1+a\_2+\cdots+a\_N=S
  • For each ii (1iN1 \leq i \leq N), there exists an integer jj such that a_i=A_ja\_i=A\_j.

Note that there are TT tests in one input file.

입력

Input is given from Standard Input in the following format:

TT

Description of the 1-st test

Description of the 22-nd test

\vdots

Description of the TT-th test

The description of each test is in the following format:

NN SS KK

A_1A\_1 A_2A\_2 \cdots A_KA\_K

출력

For each test, print the count modulo 22.

제한

  • 1T51 \leq T \leq 5
  • 1N10181 \leq N \leq 10^{18}
  • 0S10180 \leq S \leq 10^{18}
  • 1K2001 \leq K \leq 200
  • 0A_1<A_2<<A_K1050 \leq A\_1 < A\_2 < \cdots < A\_K \leq 10^5
  • All values in input are integers.

힌트

In the first test, there are a total of 5151 sequences that satisfy conditions.