Ticket 11745
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
6
100101
101001
111100
5
3 5
2 4
2 4
3 5
4 4
Expected Output
2
2
2
2
2
Generator Parameters
--n_high 15 --n_low 1 --q_high 9 --q_low 1