Ticket 4532
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
111101101011
000011110111
111001010001
6
7 11
6 12
2 7
6 10
3 12
5 8
Expected Output
3
3
3
3
5
1
Generator Parameters
--n_high 15 --n_low 1 --q_high 9 --q_low 1