Ticket 327
Problem 1637 -f
Submission 146145309
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
7
4 7 8 6 5 9 1 
3 4
2 4
6 4
4 7
1 2
6 5
Expected Output
26
Your Output
27
Difference
Generator Parameters
--h_cap 1000000000 --h_high 9 --h_low 1 --n_cap 200000 --n_high 7 --n_low 2