Editorial for GFSSOC '15 Fall S2 - Hearth


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Since the bounds on N are so small, we can simply use 3 for loops to check all possible combinations, appending all valid ones into a list, and then sorting everything. This problem is similar to a past CCC question, The Students' Council Breakfast.


Comments

There are no comments at the moment.