Taxi
Alina wants to book a taxi using a popular app. Several drivers are available to accept her request.
Alina is a conscientious person and prefers to ride with the most experienced driver, which means the one who has completed the most trips. However, the app does not display the number of trips each driver has completed. The only information available to Alina is the driver's rating.
After each trip, passengers rate the driver with an integer from 1 to 5 inclusive. The driver's rating R is calculated as the arithmetic mean of all the ratings received.
Task
Your task is to write a program that determines the minimum number of trips a driver must have completed to achieve a rating of exactly R (without rounding).
Input
The input consists of a single line containing a real number R (1 ≤ R ≤ 5), representing the driver's rating with a precision of up to 18 decimal places.
Output
On the first line of the output, print a single natural number representing the minimum number of trips, or -1 if the specified rating is impossible to achieve.
If the rating is achievable, on the second line, print 5 non-negative integers representing the number of ratings 1, 2, 3, 4, and 5 respectively, that the driver has received. If there are multiple sets of ratings that result in the optimal answer, any of them may be printed.
Scoring
Subtask Points Additional Constraints Required Subtasks
0 0 Tests from the condition -
1 41 Precision of R no more than 1 decimal place -
2 33 Precision of R no more than 6 decimal places 0, 1
3 26 Precision of R no more than 18 decimal places 0, 1, 2