#SP0000204. Số mũ nguyên tố trong giai thừa (Factors and Factorials)
Bài tập thuộc lộ trình
Mục lục đề ⌄
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 , represent by listing the exponents of every prime in increasing prime order. For each prime , its exponent is the greatest integer such that divides .
Print this exponent list using the required fixed-width format. The first line starts with and ! =. Each exponent is right-aligned in a field of width . The first line contains at most exponents; each following line starts with six spaces and contains at most exponents.
Input
The only line contains the integer .
Output
Print right-aligned in a field of width , then the literal ! =. Print every exponent in a field of width . Before a continuation line print exactly six spaces.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
5
Output
5! = 3 1 1
Explanation
Since , the exponents are . The leading is right-aligned in width , giving two preceding spaces. Each exponent is printed in a width- field. No continuation line is required.