yukicoder-577

从 Trac 迁移的文章

这是从旧校内 Wiki 迁移的文章,可能存在一些样式问题,您可以向 memset0 反馈。

原文章内容如下:

{{{
#!html
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
<script type="text/javascript" async src="http://10.71.10.90/sfiction/tool/MathJax/MathJax-master/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<style>
.input, pre {
    display: block;
    padding: 9.5px;
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.42857143;
    color: #333;
    word-break: break-all;
    word-wrap: break-word;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
}
</style>
}}}

== [https://yukicoder.me/problems/no/577 No.577 Prime Powerful Numbers] ==

=== Description ===

{{{
#!html
<p>给出一个正整数$N$,求能否找到素数$p$和$q$,正整数$a$和$b$,使得$N=p^a+q^b$。
</p>
}}}

=== Input ===

{{{
#!html
<p class="input">
$Q$<br>
$N_1$<br>
$N_2$<br>
$\vdots$<br>
$N_Q$
</p>
<p>
$1 \le Q \le 200, 1 \le N_i \le 10^{18}$
</p>
}}}

=== Output ===

{{{
#!html
<p>对于每组数据,如果可以找到,输出"Yes",否则输出"No"。</p>
}}}

=== Sample ===

==== Sample 1 ====
输入
{{{
#!html
<pre>
2
251
149
</pre>
}}}
输出
{{{
#!html
<pre>
Yes
No
</pre>
}}}

No.577 Prime Powerful Numbers

Description

给出一个正整数$N$,求能否找到素数$p$和$q$,正整数$a$和$b$,使得$N=p^a+q^b$。

Input

$Q$
$N_1$
$N_2$
$\vdots$
$N_Q$

$1 \le Q \le 200, 1 \le N_i \le 10^{18}$

Output

对于每组数据,如果可以找到,输出"Yes",否则输出"No"。

Sample

Sample 1

输入

2251149

输出

YesNo