Ticket 4526
Problem 1661 -e
View hacks & all small testcases

Unable to dry run this testcase?
Try making a new request with small values of n_high, t_high, *_high, etc.


Retry
Input
29
00010001100101010001100001000
11001111001110000001111010011
11011111110101100111111001001
10
1 12
1 29
17 20
4 23
14 17
6 29
5 21
16 29
17 27
3 8
Expected Output
4
12
1
7
3
10
6
6
4
2
Generator Parameters
--n_high 30 --n_low 10 --q_high 10 --q_low 10