提示: 欢迎访问OurACM平台。
Problem 1527 Perfect Pairs

Accept: 184    Submit: 1040
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

There are n numbers, you can choose two numbers a, b. If the value of a/b is nearest to r, we say a, b are the perfect pairs.

Input

There are several test cases. The fist line of each case contains two numbers n, r (1<n≤50000, 0<r<1), the next line contains n positive integers which is less than 10^5.

Output

Output the most perfect numbers. If there is more than one solution, output the one with the smallest value of a+b.

Sample Input

4 0.50 1 2 3 4

Sample Output

1 2

Source

FZU 2007 ICPC Qualification Round II

Submit  Back  Status  Discuss