atcoder#ABC251D. [ABC251D] At Most 3 (Contestant ver.)

[ABC251D] At Most 3 (Contestant ver.)

Score : 400400 points

Problem Statement

You are given an integer WW. You are going to prepare some weights so that all of the conditions below are satisfied.

  • The number of weights is between 11 and 300300, inclusive.
  • Each weight has a mass of positive integer not exceeding 10610^6.
  • Every integer between 11 and WW, inclusive, is a good integer. Here, a positive integer nn is said to be a good integer if the following condition is satisfied:- We can choose at most 3 different weights from the prepared weights with a total mass of nn.

Print a combination of weights that satisfies the conditions.

Constraints

  • 1W1061 \leq W \leq 10^6
  • WW is an integer.

Input

Input is given from Standard Input in the following format:

WW

Output

Print in the following format, where NN is the number of weights and AiA_i is the mass of the ii-th weight. If multiple solutions exist, printing any of them is accepted.

NN

A1A_1 A2A_2 \dots ANA_N

Here, NN and A1,A2,,ANA_1,A_2,\dots,A_N should satisfy the following conditions:

  • 1N3001 \leq N \leq 300
  • 1Ai1061 \leq A_i \leq 10^6
6
3
1 2 3

In the output above, 33 weights with masses 11, 22, and 33 are prepared. This output satisfies the conditions. Especially, regarding the 33-rd condition, we can confirm that every integer between 11 and WW, inclusive, is a good integer.

  • If we choose only the 11-st weight, it has a total mass of 11.
  • If we choose only the 22-nd weight, it has a total mass of 22.
  • If we choose only the 33-rd weight, it has a total mass of 33.
  • If we choose the 11-st and the 33-rd weights, they have a total mass of 44.
  • If we choose the 22-nd and the 33-rd weights, they have a total mass of 55.
  • If we choose the 11-st, the 22-nd, and the 33-rd weights, they have a total mass of 66.
12
6
2 5 1 2 5 1

You may prepare multiple weights with the same mass.