Ticket 7882
Problem 1677 -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
2
9
9 4 1 5 8 2 6 7 3 
2 9 3 4 6 1 5 7 8 
9
7 2 3 8 9 6 5 1 4 
5 2 8 6 3 7 1 4 9 
Expected Output
40
40
Generator Parameters
--n_high 9 --n_low 1 --t_high 2 --t_low 1