#ENGLISHP16. Maximum Sum Not Exceeding K
Maximum Sum Not Exceeding K
Description
Given N numbers, find two different numbers from them such that the sum of the two numbers is maximum but not exceeding K.
Input Format
First line: two positive integers N (N <= 1000) and K (K <= 1000000).
Second line: N positive integers (<= 1000000).
Output Format
Two integers.
5 14
2 4 7 3 9
4 9