Squarefree Check

Squarefree Check

Hard Computer Mathematics Primes & Factorization 35 views
Explanation Complexity

Problem Statement

Print YES if n is squarefree (no prime square divides it).

Input Format

One integer n.

Output Format

YES or NO.

Example

18
NO

Constraints

2

Input / Output Format

Input Format
One integer n.
Output Format
YES or NO.
Constraints
2

Examples

Input:
18
Output:
NO

Example Solution (Public)

Computer Mathematics
Factor n; if any prime has exponent>=2 then NO else YES.

Official Solution Code

Factor n; if any prime has exponent>=2 then NO else YES.
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.