Preparing NOJ

Maximum Sum Not Exceeding K

1000ms 65536K

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:

First line: two positive integers N (N <= 1000) and K (K <= 1000000).
Second line: N positive integers (<= 1000000).

Output:

Two integers.

Sample Input:

5 14
2 4 7 3 9

Sample Output:

4 9

Info

NOIOPEN

Provider NOIOPEN

Origin 简单英文题

Code NOIOPJENGLISH16

Tags

Submitted 0

Passed 0

AC Rate 0%

Date 08/15/2021 18:56:22

Related

Nothing Yet