In Casino Royale, one of the famous games is played on a decimal string s1s2…sn, where si∈ {'1', '2'}. The two pla
Before the first move of a game, the observers can see a portion of bits in the string, then make a bet on who will win in the end. Little Q is the owner of the Casino Royale. He is interested in how to predict the result of the above game such that he can earn a lot of money by predicting.
You will be given the initial string with some bits hidden. Little Q will then give you q queries. In each query, you will be given two integers A and B, denoting the final scores of the first pla
The first line contains a single integer T (1≤T≤100), the number of test cases. For each test case:
The first line contains two integers n and q (1≤n≤50, 1≤q≤(2n+1)(2n+1)), denoting the length of the initial string and the number of queries.
The second line contains a string s of length n (si∈ {'1', '2', '?'}), denoting the initial string that can be seen by the observers. Here '??' denotes the value of the corresponding bit is hidden.
Each of the following q lines contains two integers A and B (0≤A,B≤2n), denoting a query.
2
3 2
121
2 2
1 3
2 4
??
1 1
2 2
2 1
1 2
1
0
1
1
2
0