i have trouble understanding this problem . can any one explain? thanks :)
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
i have trouble understanding this problem . can any one explain? thanks :)
Name |
---|
The secret costs n marks.
Now, the unlucky buyer does not have coins such that it is possible to pay exactly n marks. But he has enough coins to pay more than n marks. He will also use as few coins as possible to pay more than n marks.
Now you want to find what might be the worst possible case for the unlucky buyer. You want to find out the maximum number of coins the unlucky buyer might be forced to pay.
For example, if the cost of the secrets is 15.
The unlucky buyer must have enough money to pay more than 15 marks. But he must not be able to pay exactly 15 marks.
If he has 5 coins of 3, then he will be able to pay exactly 15. Therefore, we must not consider this case at all. If he has 2 coins of 9, 1 coin of 3, 2 coins of 1, then he will use 2 coins of 9 to pay 18 marks. If he has 1 coin of 27, he will use 1 coin of 27 to pay 27 marks.
The worst possible case, such that the unlucky buyer can pay more than 15, is when he has to pay using 2 coins of 9.
thanks :)
let's consider all the combinations with this conditions :
in this problem you should calculate maximum number of coin between valid combinations.
thanks ,it was beneficial :)