Maintain the Queue

Limits: 3s, 512 MB

“Ajob Desh” is a digitalized analog country. As there is no online ticket booking support, people need to buy their train ticket directly from the railway station by maintaining a queue in front of the ticket counter.

This is a companion discussion topic for the original entry at

Blockquote Why show WA for 2nd case & further?
Someone pls hlp

This problem is a complete copy from spoj . Shame !! How can they use copy paste problem in a national contest .

Spoj problem was uploaded in 2013 , and NSU cyberbauts’16 held on 2016 . So it’s copy and pasted , but slightly changed .