Maximum Sum Not Exceeding K
https://acs.jxnu.edu.cn/problem/NOIOPJENGLISH16
1000ms 65536K
描述:
Given N numbers, find two different numbers from them such that the sum of the two numbers is maximum but not exceeding K.
给出n个数,从中找出两个不同的数且这两个数的和最大但不超过k
输入:
First line: two positive integers N (N <= 1000) and K (K <= 1000000).
Second line: N positive integers (<= 1000000).
第一行:两个正整数表示n和k
第二行:n个正整数
输出:
Two integers.
两个整数
样例输入:
5 14 2 4 7 3 9
样例输出:
4 9