Ticket 4536
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
45
111101001000011000011111100100101001000111001
111111101100111001001001010101101110001010011
100011000010101011011000101111000010001001101
10
27 34
36 43
18 29
24 45
9 35
22 24
15 39
11 20
1 44
8 45
Expected Output
2
4
5
10
9
1
9
5
15
14
Generator Parameters
--n_high 100 --n_low 1 --q_high 10 --q_low 10