Mafia
문제
A mafia has infiltrated the city <insert name here>. This has made the police force of <insert name here> very confused, with accusations of corruption being made in every direction. The city's cops (which are numbered between and ) has made a number of accusations about other policemen. Each accusation is either:
- Police number is an honest cop.
- Police number is a corrupt cop.
An honest cop always tells the truth, while a corrupt cop always lies. In total, there has been accusations.
The chief of police is now trying to fix the situation, starting with determining how many of her police men are corrupt. She has different guesses about the number of corrupt cops, and for each such number , she wants to know how many different sets of size can be corrupt (where all the remaining cops are honest), given that all accusations are consistent.
입력
The sample judge reads input in the following format:
- line :
N M - line :
A[0] ... A[M - 1] - line :
B[0] ... B[M - 1] - line :
T[0] ... T[M - 1] - line :
G: the number of calls made toguess(C). - line
C1 ... CG: the parameters of the calls toguess(C).
출력
The sample judge will write lines with the return values of guess(C).
예제
예제 1
3 2 1 2 0 1 2 2 4 0 1 2 3
0 1 1 0