A - Count Down Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 100100

問題文

NN 以下の非負整数を大きい方から順にすべて出力してください。

制約

  • 1N1001 \leq N \leq 100
  • NN は整数

入力

入力は以下の形式で標準入力から与えられる。

NN

出力

NN 以下の非負整数が XX 個存在するとき、XX 行出力せよ。
i=1,2,,Xi=1,2,\ldots,X に対し、ii 行目には NN 以下の非負整数のうち大きい方から ii 番目のものを出力せよ。


入力例 1Copy

Copy
3

出力例 1Copy

Copy
3
2
1
0

33 以下の非負整数は 0,1,2,30,1,2,344 個です。
11 行目に 33 を、22 行目に 22 を、33 行目に 11 を、44 行目に 00 を出力することでこれらを大きい方から順に出力したことになります。


入力例 2Copy

Copy
22

出力例 2Copy

Copy
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0

Score : 100100 points

Problem Statement

Print all non-negative integers less than or equal to NN in descending order.

Constraints

  • 1N1001 \leq N \leq 100
  • NN is an integer.

Input

The input is given from Standard Input in the following format:

NN

Output

Print XX lines, where XX is the number of non-negative integers less than or equal to NN.
For each i=1,2,,Xi=1, 2, \ldots, X, the ii-th line should contain the ii-th greatest non-negative integer less than or equal to NN.


Sample Input 1Copy

Copy
3

Sample Output 1Copy

Copy
3
2
1
0

We have four non-negative integers less than or equal to 33, which are 00, 11, 22, and 33.
To print them in descending order, print 33 in the first line, 22 in the second, 11 in the third, and 00 in the fourth.


Sample Input 2Copy

Copy
22

Sample Output 2Copy

Copy
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0


2025-04-27 (Sun)
15:47:53 +00:00