Ticket 5090
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
10
0010011110
1011111101
1110110010
7
5 7
4 5
1 7
8 10
7 10
3 8
4 7
Expected Output
1
1
1
3
3
1
1
Generator Parameters
--n_high 15 --n_low 1 --q_high 9 --q_low 1