Ticket 6082
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
4
18
3 1 1 1 1 3 3 1 3 1 3 1 3 1 3 3 1
6
6 4 6 6 1 
8
5 6 5 1 7 2 7 
9
7 7 9 9 1 8 6 8 
Expected Output
7
4
6
6
Generator Parameters
--WA_ON_TC_20 6 --n_high 9 --n_low 2 --t_high 5 --t_low 1