Ticket 5095
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
010000000011000101111110100111100101111101011101000010100001111000011101110001111010001101100010000
101001000100100100001000001100011110001001100001010100010110101011101110111111100110101110000111000
001111111011110000011010110000011100001111001011011111101111010001011101010001001101100101111101110
20
63 87
24 38
2 9
14 83
46 91
24 41
43 74
29 38
18 89
13 58
12 86
17 47
32 61
9 53
58 69
6 65
8 24
18 67
82 91
7 30
Expected Output
8
5
2
24
18
5
15
3
24
17
26
10
11
17
5
23
7
18
5
10
Generator Parameters
--n_high 100 --n_low 99 --q_high 20 --q_low 15