Little Dwayne

Limits: 2s, 512 MB

Little Dwayne Johnson is hosting a programming contest. A lot of teams mail him everyday to ask about various things. Little Dwayne uses Kmail to send reply mails. But Kmail only allows sending K mails per day. If some teams don’t get any reply they become dissatisfied.

This is a companion discussion topic for the original entry at

Might there be a problem in the dataset? My last JS solution (not the previous ones, they were incorrect) is similar to the CPP solution from which I got AC. (Or, I might have made any mistake that I currently can’t figure out.)

Would love to hear back, anyway. Thanks!