B. Can you buy them all?

Problem Name:
B. Can you buy them all?
Site:AtCoder
Links:
Tags: