Ticket 7000
Problem 1672 -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
8
2
2 1 
2 1 
7
7 1 1 6 6 5 6 
6 1 6 7 6 1 5 
5
3 1 5 3 3 
3 3 5 3 1 
6
5 4 3 4 5 5 
5 5 4 4 5 3 
9
6 1 5 1 4 8 4 2 6 
5 1 8 2 1 6 4 6 4 
8
3 7 6 5 8 8 4 5 
5 6 5 8 3 7 8 4 
8
1 7 3 2 7 5 7 6 
7 6 5 1 3 2 7 7 
2
1 2 
1 2 
Expected Output
YES
NO
NO
NO
NO
NO
NO
YES
Generator Parameters
--n_high 9 --n_low 1 --t_high 10 --t_low 1