Ticket 1011
Problem 1648 -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
4 5
6 8 8 6 6 
1 7 8 8 3 
5 7 8 5 5 
6 2 5 1 8 
Expected Output
85
Generator Parameters
--col_cap 100 --col_high 5 --col_low 1 --row_cap 100 --row_high 5 --row_low 1 --val_cap 100000 --val_high 9 --val_low 1