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

35073번 - Bisecting Bargain 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB64466.667%

문제

Emilia and Alex love Christmas markets. There are so many stalls to explore and so many delicious foods to try! The options seem endless: Schupfnudeln with Sauerkraut, langos, crêpes, roasted almonds, Bratwurst, twister fries and much more.

Here in Germany, some stalls still do not accept credit cards, so Emilia and Alex need to withdraw some cash from a nearby cash machine (also called an ATM, or Automated Teller Machine). Due to some fees, it is cheaper to withdraw all the cash they need at once, so they plan to do so.

This particular cash machine works in the following way: the user inputs an integer $x,ドル and then the machine chooses a selection of coins and banknotes that sums to €$x$. The cash machine can dispense all possible Euro coins and notes with values €1ドル$ and up: €1ドル,ドル €2ドル,ドル €5ドル,ドル €10ドル,ドル €20ドル,ドル €50ドル,ドル €100ドル,ドル €200ドル,ドル and €500ドル$. It has sufficiently many coins and notes of each type to form any combination that sums to $x,ドル and you do not know in advance which of these combinations it will dispense.

Since Emilia and Alex plan to visit some different stalls independently, they want to split the withdrawn amount evenly between them. While waiting in the long queue in front of the cash machine, Emilia suddenly realizes that this might not be possible, depending on which coins and banknotes the cash machine dispenses. For example, €42ドル$ might not be evenly splittable (see Sample 1), whereas no matter how €40ドル$ is dispensed by the cash machine, the cash can always be divided into two piles of €20ドル$.

Can the money always be split evenly if they withdraw €$n$ from the cash machine?

입력

The input consists of:

  • One line with an integer $n$ (1ドル\leq n\leq 10,000円$), the amount of cash in € that Emilia and Alex want to withdraw in total.

출력

If the money can always be split evenly, output "splittable". Otherwise, output the number of coins and notes, followed by their values, such that the values add to $n$ and the money cannot be split evenly.

If there are multiple ways of choosing coins and notes that are not splittable, you may output any one of them.

제한

예제 입력 1

42

예제 출력 1

4
10 20 10 2

예제 입력 2

40

예제 출력 2

splittable

예제 입력 3

5

예제 출력 3

1
5

예제 입력 4

52

예제 출력 4

2
2 50

노트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2025 B번

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

출처

대학교 대회

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

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