Editorial for COCI '11 Contest 4 #1 Kino


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.

If there are no love seats, there are N+1 cup-holders. Every pair of love seats decreases the number of cup-holders by one. We can express this fact with the following formula:

number_of_cup_holders = N + 1 - number_of_love_seat_pairs

The solution is to output the number of cup-holders, except when there are no love seats in which case we output N.


Comments

There are no comments at the moment.