ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Поиск > задача:


50470 - Close Pairs - Revised

Гость
• Вопросы к жюри (1)

Задачи раздела

• 50450 - Last Appereance of a Number
• 50457 - The Number of Winners
• 50453 - The Cubic Difference
• 50451 - Processing Cost
• 50459 - The Biggest Digit
• 50538 - Sum of kth Diagonal
• 50465 - How many students have p...
• 50378 - Sum of the given digits
• 50470 - Close Pairs - Revised
• 50784 - Top Growing Company
• 50458 - Weekly Report
• 50478 - Letter Grades
• 50791 - Mine field
• 50867 - Average of the Best Grades
• 50782 - Max of N integers
• 50460 - Numrin e Mesem
• 50552 - Kepuce te perditshme

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Close Pair

Question: You will be given n integer numbers. Print the two numbers whose difference is the closest. Show any two, if there are many numbers giving the same minimum difference.

Input specification
You will be first given a number (n) which shows the number of numbers where 0 ≤ n ≤ 1000. Then in following n lines you will be given n numbers where each number is between -10000 and 10000.

Output specification
Print the two numbers whose difference is the closest.

 Sample Input I     Sample Input II   
 3
 8 5 6
 5
 6 -5 6 8 3
 Sample Output I     Sample Output II   
 5 6
 6 6


Для отправки решений необходимо выполнить вход.

www.contester.ru