Ticket 14170
Problem 1700 -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
4 4
6 7
Expected Output
46
168
Generator Parameters
--row_or_col_high 9 --row_or_col_low 1 --t_high 2 --t_low 1