Files
PAT/html/b1030.html
T

28 lines
939 B
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.
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h1>1030. 完美数列(25)</h1>
<div id="problemContent">
<p>
给定一个正整数数列,和正整数p,设这个数列中的最大值是M,最小值是m,如果M &lt;= m * p,则称这个数列是完美数列。
</p>
<p>现在给定参数p和一些正整数,请你从中选择尽可能多的数构成一个完美数列。</p>
<p><b>
输入格式:
</b></p>
<p>
输入第一行给出两个正整数N和p,其中N(&lt;= 10<sup>5</sup>)是输入的正整数的个数,p(&lt;= 10<sup>9</sup>)是给定的参数。第二行给出N个正整数,每个数不超过10<sup>9</sup>。
</p>
<p><b>
输出格式:
</b></p>
<p>
在一行中输出最多可以选择多少个数可以用它们组成一个完美数列。
</p>
<b>输入样例:</b><pre>
10 8
2 3 20 4 5 1 6 7 8 9
</pre>
<b>输出样例:</b><pre>
8
</pre>
</div>