PPA-9
Question
You have \(n\) gold coins with you. You wish to divide this among three of your friends under the following conditions:
- All three of them should get a non-zero share.
- No two of them should get the same number of coins.
- You should not have any coins with you at the end of this sharing process.
The input has four lines. The first line contains the number of coins with you. The next three lines will have the share given to your three friends. All inputs shall be non-negative integers. If the division satisfies these conditions, then print the string FAIR
. If not, print UNFAIR
.
Hint
There are three expressions given to you here:
Now, make use of these three expressions to construct a solution. Consider another set of three expressions:
Now, make use of these three expressions to construct another solution. How are these two solutions different from each other?