1294C.md (1053B)
1 Source: https://codeforces.com/problemset/problem/1294/C 2 3 C. Product of Three Numbers 4 5 time limit per test 6 7 2 seconds 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 standard input 16 17 output 18 19 standard output 20 21 You are given one integer number $n$. Find three distinct integers $a, b, c$ such that $2 \le a, b, c$ and $a \cdot b \cdot c = n$ or say that it is impossible to do it. 22 23 If there are several answers, you can print any. 24 25 You have to answer $t$ independent test cases. 26 27 Input 28 29 The first line of the input contains one integer $t$ ($1 \le t \le 100$) — the number of test cases. 30 31 The next $n$ lines describe test cases. The $i$-th test case is given on a new line as one integer $n$ ($2 \le n \le 10^9$). 32 33 Output 34 35 For each test case, print the answer on it. Print "NO" if it is impossible to represent $n$ as $a \cdot b \cdot c$ for some distinct integers $a, b, c$ such that $2 \le a, b, c$. 36 37 Otherwise, print "YES" and any possible such representation. 38 39 Example 40 41 Input 42 43 ``` 44 5 45 64 46 32 47 97 48 2 49 12345 50 ``` 51 52 Output 53 54 ``` 55 YES 56 2 4 8 57 NO 58 NO 59 NO 60 YES 61 3 5 823 62 ```