Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
A perfect number is a number for which the sum of its divisors equals twice the number itself.
- Example: ~6~ is a perfect number because the sum of its divisors ~1 + 2 + 3 + 6 = 12 = 2 \times 6~.
Write a program that takes an integer ~n~ as input. Print YES if ~n~ is a perfect number, otherwise print NO.
Input
- A positive integer ~n~ ~(n \leq 10^{12})~.
Output
- Print YES if ~n~ is a perfect number, otherwise print NO.
Sample Input
6
Sample Output
YES
Bình luận