Ticket 4311
Problem 1661 -e
Submission 153239894
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
100
0011100010111111010010000001000010101100100110000101011100101000000111100011111001110011001011010011
0011101000001000011001010011010110001111010000000011101000010001010100101100101100101101001101010110
0010010001111000001100000100011001011101001000111011001110010110011111100001100110111010000000101101
50
25 90
14 31
41 67
7 59
34 100
41 93
5 24
71 96
20 68
14 30
40 54
36 86
57 61
55 75
54 90
12 33
80 91
71 93
6 44
19 23
70 91
65 77
27 38
31 64
44 53
4 74
2 31
66 92
2 100
18 54
34 61
45 60
33 96
57 66
7 96
58 97
20 86
6 32
14 63
49 92
51 74
70 96
28 83
12 37
64 93
43 45
3 83
43 94
50 77
43 61
Expected Output
26
8
14
23
28
21
9
10
25
8
9
18
4
9
12
9
5
8
19
3
7
3
6
18
4
31
12
7
41
19
14
7
27
7
37
16
28
12
24
16
9
10
23
12
9
2
33
19
11
9
Your Output
25
8
14
23
27
20
9
10
25
8
9
17
4
8
11
9
5
8
19
3
7
2
6
18
4
30
12
6
40
19
14
7
26
7
36
15
27
12
24
15
8
10
22
12
8
2
32
18
10
9
Difference
Generator Parameters
--n_high 100 --n_low 100 --q_high 50 --q_low 50