luogu#P10495. 阶乘分解

阶乘分解

Problem Description

Given an integer N(3N106)N (3 \le N \le 10^6), factorize the factorial N!N! into prime factors. You only need to output pip_i and cic_i in the form required by the Fundamental Theorem of Arithmetic.

Input Format

An integer NN.

Output Format

The prime factorization result of N!N!, consisting of several lines. Each line contains a pair pi,cip_i, c_i, meaning there is a term picip_i^{c_i}. Output in increasing order of pip_i.

5
2 3
3 1
5 1

Hint

Translated by ChatGPT 5