1725. Sold Out!

Problem Name:
1725. Sold Out!
Site:Timus
Links:
Tags:
Problem setters:
Denis Dublennykh (prepared by Oleg Dolgorukov)