PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000212. Tìm giai thừa có đúng m chữ số 0 cuối (A Trivial Problem)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Tìm giai thừa có đúng m chữ số 0 cuối (A Trivial Problem)

A Trivial Problem

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given a positive integer mm, find all nonnegative integers xx such that the decimal representation of x!x! has exactly mm trailing zero digits.

Print the number of solutions, followed by all solutions in increasing order. If no solution exists, print only 0.

Input

The only line contains the integer mm.

Output

On the first line, print the number of solutions. If positive, the second line contains all solutions in increasing order, separated by single spaces.

Subtasks

  • Subtask 1 (20 points): 1≤m≤501\le m\le 50.
  • Subtask 2 (30 points): 1≤m≤50001\le m\le 5000.
  • Subtask 3 (50 points): 1≤m≤1051\le m\le 10^5.

Examples

Input

1

Output

5
5 6 7 8 9

Explanation

5!=1205!=120 has one trailing zero. Multiplication by 6,7,8,96,7,8,9 introduces no additional factor 55, so 6!,7!,8!,9!6!,7!,8!,9! also have exactly one trailing zero. At 10!10!, the count becomes 22. Hence the five solutions are 5,6,7,8,95,6,7,8,9.