#C9218. Largest Prime Factor
Largest Prime Factor
Largest Prime Factor
Given an integer \( n \) (where \( n \geq 2 \)), your task is to compute its largest prime factor. Recall that any integer \( n \) can be expressed as a product of primes:
\( n = p_1^{a_1} \times p_2^{a_2} \times \cdots \times p_k^{a_k} \)
Your goal is to find \( \max(p_1, p_2, \ldots, p_k) \).
The input will be provided from stdin
and your output (the largest prime factor) should be written to stdout
.
inputFormat
The input consists of a single integer \( n \) (\( n \geq 2 \)), provided via stdin
.
outputFormat
Output the largest prime factor of \( n \) to stdout
.
10
5