P29315 [洛谷] [NOI Online #1 Junior Group] Stationery Order
普及
题目描述

Problem Description

Xiao Ming's class has a total of $n$ yuan in class funds, and the students plan to use this money to collectively purchase 3 types of items:

  1. Compasses, each costing 7 yuan.
  2. Pens, each costing 4 yuan.
  3. Notebooks, each costing 3 yuan.

Xiao Ming is in charge of ordering the stationery. Let the number of compasses, pens, and notebooks ordered be $a, b, c$ respectively. His ordering principles are as follows:

  1. The $n$ yuan must be exactly spent, i.e., $7a + 4b + 3c = n$.
  2. Under the condition above, the number of sets should be as large as possible, i.e., the minimum value among $a, b, c$ should be as large as possible.
  3. Under the conditions above, the total number of items should be as large as possible, i.e., $a + b + c$ should be as large as possible.

Please help Xiao Ming find the optimal plan that satisfies these conditions. It can be proven that if a solution exists, the optimal solution is unique.

Input Format

The input consists of a single line containing an integer, representing the amount of class funds $n$.

Output Format

If there is no solution, output $-1$.

Otherwise, output a single line containing three integers $a, b, c$ separated by spaces, representing the number of compasses, pens, and notebooks respectively.

Sample Input and Output

Sample Input #1

1

Sample Output #1

-1

Sample Input #2

14

Sample Output #2

1 1 1

Sample Input #3

33

Sample Output #3

1 2 6

Notes

Explanation of Sample Input and Output #3

$a = 2, b = 4, c = 1$ is also a solution that satisfies conditions 1 and 2, but for condition 3, this solution only purchases 7 items, which is not as good as the solution $a = 1, b = 2, c = 6$.

Data Range and Constraints

  • For test cases 1 through 6, $n \leq 14$.
  • For test cases 7 through 12, $n$ is a multiple of 14.
  • For test cases 13 through 18, $n \leq 100$.
  • For all test cases, $0 \leq n \leq 10^5$.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1
样例输出
-1