Ticket 4805
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
9
001010111
110110110
011001010
6
1 9
2 7
3 6
1 6
4 8
4 9
Expected Output
5
5
4
4
3
3
Generator Parameters
--n_high 15 --n_low 1 --q_high 9 --q_low 1