Ticket 16666
Problem 1661 -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
5 4
621 256 707 811 280 
Expected Output
691
Generator Parameters
--b_high 999 --b_low 1 --n_high 9 --n_low 1