Ticket 349
Problem 1637 -e
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
5
6 8
6 7 1 4 6 3 
1 6
6 7
1 3
3 6
1 4
1 7
3 4
4 7
5 5
1 3 7 2 1 
2 7
1 3
2 3
1 7
3 7
2 0
9 2 
4 0
7 9 9 8 
2 0
6 9 
Expected Output
30
9
22
51
30
Generator Parameters
--choose_dynamic_m 1 --m_cap 300000 --m_high 4 --m_low 0 --n_cap 300000 --n_high 10 --n_low 2 --t_cap 10000 --t_high 5 --t_low 1 --val_cap 100 --val_high 9 --val_low 1