Ticket 11826
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
13
1001100011111
1100111111110
0010101100010
5
12 13
1 11
1 3
4 11
5 13
Expected Output
1
3
2
1
1
Generator Parameters
--n_high 15 --n_low 1 --q_high 9 --q_low 1