408464: GYM103134 I Competitive Mario Kart

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

I. Competitive Mario Karttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

After much insistence on the part of his friends, Raphael "Raphael with 'ph'" Ribeiro finally bought the Mintendo Troca-Troca version of the iconic Mario Kart, an unconventional racing game. In it, competitors go through tracks in different scenarios in the Mintendo world, accumulating points depending on their placement. The first place would receive $$$ 15 $$$ points, the second $$$ 12 $$$, the third $$$ 10 $$$, the fourth $$$ 9 $$$, and so on until the twelfth place, which receives $$$ 1 $$$ point.

After a lot of training, Raphael realized that not only did he manage to win all the races, but he was also able to stay in whatever position he wanted. Upon discovering Raphael's abilities, Noronha, a Mario Kart expert, soon became interested in launching a challenge for him. Given a $$$ N $$$ score, if Raphael managed to hit it in as few races as possible on Mario Kart, then Noronha would award $$$ N $$$ moneys to Raphael. If that didn't happen, then it would be Raphael who would be in a $$$ N $$$ moneys debt with Noronha.

Even though he is confident of his abilities, Raphael does not want to stand a chance of losing his money, so he asked for your help! Write a program that discovers a sequence of placements that he must reach in Mario Kart to get exactly $$$ N $$$ points so that it is as small as possible!

Input

A single integer $$$ N $$$ $$$ (1 \leq N \leq 10^6) $$$ ─ the sum of points that Raphael wants to achieve.

Output

The first line must contain a single integer $$$ S $$$ ─ the size of the smallest sequence of placements in order for Raphael to get exactly $$$ N $$$ points.

The second must contain $$$ S $$$ integers $$$ p_i $$$ $$$ (1 \leq p_i \leq 12) $$$ ─ the position Raphael must reach in the $$$ i $$$-th race, in any order.

ExamplesInput
28
Output
3
1 2 12
Input
11
Output
2
3 12
Input
100
Output
7
1 1 1 1 1 1 3

加入题单

上一题 下一题 算法标签: