PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000192. Tách thành ba thừa số phân biệt (Product of Three Numbers)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Tách thành ba thừa số phân biệt (Product of Three Numbers)
Tách thành ba thừa số phân biệt (Product of Three Numbers)
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given , find three pairwise distinct integers with , or print NO if none exists. If possible, print YES and any valid triple.
Input
One integer .
Output
Print NO, or print YES followed by on the next line.
Subtasks
-
Subtask 1 (20 points): .
-
Subtask 2 (30 points): .
-
Subtask 3 (50 points): .
Examples
Example 1
Input
64
Output
YES
2 4 8
Explanation
The distinct factors are all greater than one, and their product is .
Example 2
Input
32
Output
NO
Explanation
Every factorization of into three integers greater than one repeats at least one factor, so the answer is impossible.
Example 3
Input
12345
Output
YES
3 5 823
Explanation
The factors are distinct and their product is .