| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 6 | 4 | 4 | 66.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:
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.
42
4 10 20 10 2
40
splittable
5
1 5
52
2 2 50
ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2025 B번