OpenJudge - 26:The Nearest Number
描述
Given a sequence of N number and K. Find the nearest number X in the sequence that the absolute value of (X minus K) is minimum.
输入
First line: two positive integers N (N <= 100) and K (K <= 100000).
Second line: N positive integers (<= 100000).
输出
One integer X.
翻译:给出一个有N个数的序列和K,找到最接近的X个数(X-K)。
输入:
第一行:两个正整数N和K。
第二行;N个正整数。
输出:
一个数X。