#P13678. [GCPC 2023] Mischievous Math

[GCPC 2023] Mischievous Math

题目描述

Max enjoys playing number games, whether it involves finding a combination that leads to a given result or discovering all possible results for some given integers. The problem is that Max is only 10 and has limited mathematical knowledge, which restricts the possibilities for these games. Luckily, in today's maths class, Max learned the concept of parentheses and their effects on calculations. He realises that incorporating parentheses into his number games could make them much more interesting. After getting home from school, he asked his sister Nina to play a variant of his favourite number game with him, using parentheses.

:::align{center} Max trying to solve the third sample. :::

In this new game, Max first tells her a number dd. Nina then tells him three numbers aa, bb and cc. Now, Max needs to find an arithmetic expression using addition, subtraction, multiplication and division, using each of these three numbers (aa, bb and cc) at most once, such that the result is equal to dd. The numbers a,b,ca, b, c and dd all have to be distinct, and Max is allowed to use parentheses as well.

For instance, for a=5a = 5, b=8b = 8, c=17c = 17 and d=96d = 96 a possible solution would be (175)×8=96(17 - 5) \times 8 = 96, and for a=3a = 3, b=7b = 7, c=84c = 84 and d=12d = 12 a possible solution would be 84÷7=1284 \div 7 = 12, without using the 33.

Nina is quickly annoyed by this game. She would rather spend the afternoon with her friends instead of playing games with her little brother. Therefore, she wants to give him a task that occupies him for as long as possible. Help her to find three numbers aa, bb and cc such that it is impossible for Max to come up with a solution.

输入格式

The input consists of:

  • One line with an integer dd (1d1001 \le d \le 100), Max's chosen number.

输出格式

Output three numbers aa, bb and cc (1a,b,c1001 \le a,b,c \le 100) such that the numbers aa, bb, cc and dd are pairwise distinct and there is no solution to the number game.

5
1 20 30
100
33 55 77
3
11 9 4