All about problems in Volume 3. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
Moderator: Board moderators
This problem proved to be trickier than I'd anticipated. Here are some input / output cases that helped me test / debug my code.
See https://www.udebug.com/UVa/371 instead.
Code: Select all
Deleted input / output because it was incorrect.