Ticket 12534
Problem 1694 -d
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
5
1 1 3 4 
3 4
2 3
8 9
4 9
6 7
Expected Output
3
Generator Parameters
1 1 100 1 100 1