Submit | All submissions | Best solutions | Back to list |
EIEASY06 - Conditional maximum value |
Given a list of N integers, find the largest number in which does not exceed the given K value.
Input
+ The first line contains two integers N and K
+ The second line contains N integers ai (-109 <ai <109)
Output
+ Output the largest number, or -1 if there is no number meet the condition
Example
Input: 5 6
7 9 4 1 1 Output: 4
Added by: | Ha Minh Ngoc |
Date: | 2015-01-28 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | CSHARP C++ 4.3.2 CPP CPP14 JAVA |