Ticket 4818
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
1
17
3 7 5 1 5 9 3 6 2 6 3 1 3 9 3 3 4 
Expected Output
54
Generator Parameters
--h_high 9 --h_low 1 --n_high 30 --n_low 1 --t_high 40 --t_low 1