Ticket 5096
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
99
010001011110001011011011010100100101100000011111100101111110010110110010110011100110000010000011011
101101011100011111000111000011010111111000110110001100011000000001100101101001111011101010010010100
011100101011011011001010001010101000100011001011001111110101001110100100100101110110010111000100110
20
49 63
43 81
18 31
44 91
32 55
39 91
55 74
28 57
69 98
1 59
26 99
59 59
64 77
11 66
23 86
5 46
13 50
37 66
5 90
47 64
Expected Output
6
15
10
19
8
21
10
11
15
25
34
1
9
25
28
20
16
11
37
7
Generator Parameters
--n_high 100 --n_low 99 --q_high 20 --q_low 15