Ticket 4842
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
5
11001
00101
00111
5
3 4
2 5
1 3
5 5
1 3
Expected Output
1
2
2
1
2
Generator Parameters
--n_high 5 --n_low 5 --q_high 5 --q_low 5