mirror of
https://github.com/xlucn/PAT.git
synced 2026-10-30 00:37:37 +08:00
25 lines
1.1 KiB
HTML
25 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<h1>1085. Perfect Sequence (25)</h1>
|
|
<div id="problemContent">
|
|
<p>
|
|
Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M <= m * p where M and m are the maximum and minimum numbers in the sequence, respectively.
|
|
</p>
|
|
<p>Now given a sequence and a parameter p, you are supposed to find from the sequence as many numbers as possible to form a perfect subsequence.
|
|
</p>
|
|
<p><b>
|
|
Input Specification:
|
|
</b></p>
|
|
<p>Each input file contains one test case. For each case, the first line contains two positive integers N and p, where N (<= 10<sup>5</sup>) is the number of integers in the sequence, and p (<= 10<sup>9</sup>) is the parameter. In the second line there are N positive integers, each is no greater than 10<sup>9</sup>.</p>
|
|
<p><b>
|
|
Output Specification:
|
|
</b></p>
|
|
<p>For each test case, print in one line the maximum number of integers that can be chosen to form a perfect subsequence.</p>
|
|
<b>Sample Input:</b><pre>
|
|
10 8
|
|
2 3 20 4 5 1 6 7 8 9
|
|
</pre>
|
|
<b>Sample Output:</b><pre>
|
|
8
|
|
</pre>
|
|
</div> |