#P2043. 质因子分解

质因子分解

Description

Perform the prime factorization of N!N!.

Input Format

The input consists of a single line containing a positive integer NN, with N10000N \leq 10000.

Output Format

Output multiple lines. Each line contains two positive integers pp and aa, separated by a single space, indicating that N!N! contains aa copies of the prime factor pp. Output them in increasing order of pp.

10
2 8
3 4
5 2
7 1

Hint

$10! = 3628800 = (2^8) \times (3^4) \times (5^2) \times 7$.

Translated by ChatGPT 5