#C4896. Determine if a Number is Square-Free
Determine if a Number is Square-Free
Determine if a Number is Square-Free
A positive integer \( n \) is called square-free if there is no integer \( k > 1 \) such that \( k^2 \) divides \( n \). In other words, \( n \) is square-free if for every integer \( k \ge 2 \), \( k^2 \) does not divide \( n \). Given an integer \( n \) (where \( 1 \le n \le 10^6 \)), your task is to determine whether it is square-free.
For example, \( 10 \) is square-free because no square greater than \( 1 \) divides it, while \( 18 \) is not square-free since \( 9 \) (which is \( 3^2 \)) divides \( 18 \).
inputFormat
The input consists of a single integer \( n \) provided via standard input.
Example Input:
10
outputFormat
Output a single line containing "YES" if \( n \) is square-free; otherwise, output "NO".
Example Output:
YES## sample
10
YES