Ticket 4539
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
27
100110111101010101100000111
001010011010100011000000010
010111100101001001010100000
10
1 1
5 26
6 22
21 24
12 22
23 26
8 11
16 22
13 17
10 14
Expected Output
1
14
13
1
9
1
3
4
5
7
Generator Parameters
--n_high 100 --n_low 1 --q_high 10 --q_low 10