当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5403:Goldbach's Conjecture

Special Judge 特殊评判
题目描述
Let $d(x)$ be the sum of all divisors of $x$. $x$ is called a good number if every number from 1 to $d(x)$ can be expressed as a sum of distinct divisors of $x$.

For example, $6$ is a good number, $d(6)=1+2+3+6=12$, $4=1+3,5=2+3,7=1+6$ and so on.

Teacher Mai wants to know whether a even number $p$ can be expressed as a sum of two good numbers.
输入解释
There are multiple test cases(about $40000$).

For each test case, there is only one line contains one even number $p(1\leq p\leq 10^{18})$.

Most test cases are generated randomly.
输出解释
For each test case, print "YES" or "NO" in the first line. That means if is possible to express $p$ as a sum of two good numbers.

If your answer is "YES", print two number $a,b$ in the second lines. Both $a$ and $b$ should be good numbers, and $a+b=p$.

In the third and the fourth line, print the factorization of number $a$ and $b$. If $a=\prod_{i=1}^k p_i^{e_i}$, where $p_1<p_2<\cdots<p_k$, $p_i$ are all prime numbers and $e_i\geq 1$, you should print $k$ first, then $2k$ space-seperated numbers $p_1,e_1,p_2,e_2,\cdots,p_k,e_k$.
输入样例
18
输出样例
YES
6 12
2 2 1 3 1
2 2 2 3 1
提示
0 is not a good number. 
来自杭电HDUOJ的附加信息
Author xudyh
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5403

最后修改于 2020-10-25T23:22:23+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 65536/65536K(Java/Others)