#P6702. [COCI 2010/2011 #7] ŠEĆER
[COCI 2010/2011 #7] ŠEĆER
Description
Mirko needs to deliver candies to a candy store somewhere.
Mirko can use two types of boxes:
- Type box, which can hold candies.
- Type box, which can hold candies.
Mirko wants to use as few boxes as possible. For example, if he needs to deliver candies, he could use type boxes. However, the best strategy is to use type boxes and type box, for a total of boxes.
Please help Mirko find the minimum number of boxes needed.
Input Format
The input has one line.
The first line contains a positive integer , representing the number of candies.
Output Format
The output has one line.
The first line contains a positive integer, the minimum number of boxes needed. If it is impossible to deliver candies using these types of boxes, output -1.
4
-1
9
3
18
4
Hint
Constraints
For of the testdata, .
Notes
This problem is worth points.
Translated from COCI2010-2011 CONTEST #7 T1 ŠEĆER.
Translated by ChatGPT 5
京公网安备 11011102002149号