Ticket 4317
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
12
000101010000
011110110000
100111111010
9
5 12
4 12
6 10
8 9
2 9
1 5
7 9
9 10
1 11
Expected Output
3
3
2
1
2
2
1
1
4
Generator Parameters
--n_high 15 --n_low 1 --q_high 9 --q_low 1