Ticket 12511
Problem 1665 -c
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
18
3 1 1 1 1 3 3 1 3 1 3 1 3 1 3 3 1
20
10 13 6 12 12 6 18 15 12 6 1 10 13 11 9 9 6 16 12 
2
1 
11
7 4 1 4 3 6 6 7 2 4 
2
1 
Expected Output
7
11
2
7
2
Generator Parameters
--WA_ON_TC_20 1 --n_high 20 --n_low 2 --t_high 5 --t_low 5