Ticket 4528
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
47
10101011110100101111001011100001000011000011110
01000110100001100000101100101001110110010001100
10001100111000110011000110100110001001111000111
10
2 5
16 31
3 27
30 38
36 43
17 30
12 38
40 43
33 36
24 35
Expected Output
4
8
10
5
3
7
13
2
3
6
Generator Parameters
--n_high 50 --n_low 20 --q_high 10 --q_low 10