Ticket 1901
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
1
4 7
4 9 7 3 
6 1 7 8 
Expected Output
29
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