Ticket 312
Problem 1629 -a
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
7 8
3 5 6 9 4 3 1 
3 5 5 9 3 8 3 
9 7
5 2 5 8 2 4 4 3 4 
7 7 1 4 5 7 9 8 8 
Expected Output
44
63
Generator Parameters
--k_cap 1000 --k_high 9 --k_low 1 --n_cap 100 --n_high 9 --n_low 1 --t_cap 100 --t_high 2 --t_low 1 --val_cap 1000 --val_high 9 --val_low 1