Ticket 4817
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
9
7
3 5 8 7 7 6 9 
9
9 8 6 4 3 1 5 3 2 
3
9 5 9 
7
6 7 2 5 3 4 8 
7
9 8 2 3 8 5 1 
8
1 2 3 8 9 5 2 3 
5
2 7 2 6 9 
7
9 8 7 9 2 6 6 
2
8 7 
Expected Output
12
27
3
14
18
26
13
11
1
Generator Parameters
--h_high 9 --h_low 1 --n_high 9 --n_low 1 --t_high 10 --t_low 1