#C202. Largest Prime Factor
Largest Prime Factor
Largest Prime Factor
You are given a positive integer n. Your task is to find the largest prime factor of n. Formally, if the set of prime factors of n is \(P = \{p_1, p_2, \dots, p_k\}\), you should output \(\max(P)\). Note that if n is 1, then its largest prime factor is defined as 1.
Input Format: A single line containing one integer n.
Output Format: Print a single integer, the largest prime factor of n.
Example:
Input: 21</p>Output: 7
inputFormat
The input consists of a single line containing one integer n (where n \(\ge 1\)).
outputFormat
Output a single integer which is the largest prime factor of n.
## sample21
7