Files
PAT/source/html/b1088.html
T

21 lines
1.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
三人行
<div class="ques-view"><p>子曰:“三人行,必有我师焉。择其善者而从之,其不善者而改之。”</p>
<p>本题给定甲、乙、丙三个人的能力值关系为:甲的能力值确定是 2 位正整数;把甲的能力值的 2 个数字调换位置就是乙的能力值;甲乙两人能力差是丙的能力值的 X 倍;乙的能力值是丙的 Y 倍。请你指出谁比你强应“从之”,谁比你弱应“改之”。</p>
<h3 id="-">输入格式:</h3>
<p>输入在一行中给出三个数,依次为:M(你自己的能力值)、X 和 Y。三个数字均为不超过 1000 的正整数。</p>
<h3 id="-">输出格式:</h3>
<p>在一行中首先输出甲的能力值,随后依次输出甲、乙、丙三人与你的关系:如果其比你强,输出 <code>Cong</code>;平等则输出 <code>Ping</code>;比你弱则输出 <code>Gai</code>。其间以 1 个空格分隔,行首尾不得有多余空格。</p>
<p>注意:如果解不唯一,则以甲的最大解为准进行判断;如果解不存在,则输出 <code>No Solution</code>。</p>
<h3 id="-1-">输入样例 1:</h3>
<pre><code class="lang-in">48 3 7
</code></pre>
<h3 id="-1-">输出样例 1:</h3>
<pre><code class="lang-out">48 Ping Cong Gai
</code></pre>
<h3 id="-2-">输入样例 2:</h3>
<pre><code class="lang-in">48 11 6
</code></pre>
<h3 id="-2-">输出样例 2:</h3>
<pre><code class="lang-out">No Solution
</code></pre>
</div>