Ticket 4454
Problem 1661 -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
10
6
4 5 3 2 7 4 
8
3 6 1 8 6 8 5 5 
5
8 4 2 4 4 
2
5 5 
2
5 4 
8
5 2 7 2 3 3 9 8 
6
1 5 6 2 3 9 
3
7 4 6 
2
6 9 
4
3 9 6 7 
Expected Output
12
15
12
0
1
22
19
3
2
8
Generator Parameters
--h_high 9 --h_low 1 --n_high 9 --n_low 1 --t_high 10 --t_low 1