Ticket 16996
Problem 1847 -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
4 2 1
1111
4 4
4 4
3
Expected Output
0
Generator Parameters
--m_high 5 --m_low 1 --n_high 5 --n_low 1 --q_high 5 --q_low 1