Ticket 4707
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
5
8 5 1 4 5 
1
1 
2
9 2 
2
8 6 
1
5 
2
1 5 
2
7 6 
8
2 6 2 8 9 6 5 5 
8
2 2 3 8 4 8 7 3 
5
1 3 9 4 2 
Expected Output
12
0
5
2
0
3
1
20
18
18
Generator Parameters
--h_high 9 --h_low 1 --n_high 9 --n_low 1 --t_high 10 --t_low 1