Ticket 4537
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
77
10010101101011010010011100000100100111100111010011000111011101101000110001001
10010001100101101110100010100001101000101100000110011010101001001100010110000
00110101001111100000110011000010110000111110100010001010010011101111000101010
10
20 61
43 62
29 66
6 43
35 73
35 74
45 53
58 68
1 60
62 72
Expected Output
18
11
15
16
14
16
4
4
26
4
Generator Parameters
--n_high 100 --n_low 1 --q_high 10 --q_low 10