Logo
(追記) (追記ここまで)

28381번 - Mischievous Math 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB4251068924.119%

문제

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.

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

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

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 $a,ドル $b$ and $c$ such that it is impossible for Max to come up with a solution.

입력

The input consists of:

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

출력

Output three numbers $a,ドル $b$ and $c$ (1ドル \le a,b,c \le 100$) such that the numbers $a,ドル $b,ドル $c$ and $d$ are pairwise distinct and there is no solution to the number game.

제한

예제 입력 1

5

예제 출력 1

1 20 30

예제 입력 2

100

예제 출력 2

33 55 77

예제 입력 3

3

예제 출력 3

11 9 4

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > German Collegiate Programming Contest > GCPC 2023 M번

  • 문제를 만든 사람: Paul Wild
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /