Ticket 4538
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
90
110001101111011010111111010110000111001111101101010000100010011001010000011011010100000101
010001101001000101011010110011000000110010001101010001101000010010100001100011101011010011
110110101010011111010100101001110111000000111011010010001110001010111000111000001100011111
10
39 90
25 59
29 73
11 20
45 71
54 81
16 38
40 57
17 59
27 51
Expected Output
23
14
19
6
13
14
10
7
18
9
Generator Parameters
--n_high 100 --n_low 1 --q_high 10 --q_low 10