Lines Per Hour

면접 대비

시간 제한1초메모리 제한1024 MB

요약
각 후보 문제를 푸는 데 필요한 코드 줄 수와 다섯 시간 동안 팀이 시간당 작성할 수 있는 줄 수가 주어질 때, 제한 시간 안에 모두 해결할 수 있는 문제의 최대 개수를 구한다.
난이도

쉬움10점 중 2점

유형
그리디, 정렬, 배열, 구현
정답자
아직 제출이 없습니다

문제

You are the chief judge for the next ICPC regional contest, and you want to make sure that it is theoretically possible for a team to solve all problems in the contest, but only if they are performing at their peak skill. With your insider knowledge, you know that the best team has a fixed limit on the number of lines of code per hour that they can successfully write.

You have a number of problems to select among and you know that each problem has a number of lines of code that would be required to solve it. You remember that regional contests are five hours long. What is the maximum number of problems you can put in the problem set so that the best team has a chance of solving all of the problems in the contest?

입력

The first line of input contains two integers nn (1≤n≤501 \le n \le 50) and lphlph (1≤lph≤5,0001 \le lph \le 5\\,000), where nn is the number of candidate problems to choose from, and lphlph is the lines of code per hour that the best team can successfully write.

Each of the next nn lines contains a single integer locloc (1≤loc≤1,0001 \le loc \le 1\\,000), which is the number of lines of code required to solve that problem.

출력

Output a single integer, which is the maximum number of problems that can be put in the problem set so that the best team has a chance to solve all of the problems.

예제1

  1. 예제 1

    입력
    10 100
    30
    300
    1000
    20
    35
    19
    84
    117
    212
    98
    
    예상 출력
    7