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

#SP0000204. Số mũ nguyên tố trong giai thừa (Factors and Factorials)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Số mũ nguyên tố trong giai thừa (Factors and Factorials)

Factors and Factorials

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given nn, represent n!n! by listing the exponents of every prime p≤np\le n in increasing prime order. For each prime pp, its exponent epe_p is the greatest integer such that pepp^{e_p} divides n!n!.

Print this exponent list using the required fixed-width format. The first line starts with nn and ! =. Each exponent is right-aligned in a field of width 33. The first line contains at most 1515 exponents; each following line starts with six spaces and contains at most 1515 exponents.

Input

The only line contains the integer nn.

Output

Print nn right-aligned in a field of width 33, then the literal ! =. Print every exponent in a field of width 33. Before a continuation line print exactly six spaces.

Subtasks

  • Subtask 1 (20 points): 2≤n≤252\le n\le 25.
  • Subtask 2 (30 points): 2≤n≤602\le n\le 60.
  • Subtask 3 (50 points): 2≤n≤1002\le n\le 100.

Examples

Input

5

Output

  5! =  3  1  1

Explanation

Since 5!=120=23⋅31⋅515!=120=2^3\cdot3^1\cdot5^1, the exponents are 3,1,13,1,1. The leading 55 is right-aligned in width 33, giving two preceding spaces. Each exponent is printed in a width-33 field. No continuation line is required.