Ticket 5549
Problem 1668 -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
11 16
1 18
Expected Output
29
-1
Generator Parameters
--row_or_col_high 20 --row_or_col_low 1 --t_high 10 --t_low 1