Ticket 5393
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
15
000111011011000
101011001000000
100010110011101
9
8 12
8 15
5 12
14 15
3 5
13 13
5 8
1 7
5 14
Expected Output
4
5
5
1
2
1
3
4
5
Generator Parameters
--n_high 15 --n_low 1 --q_high 9 --q_low 1