Logo
(追記) (追記ここまで)

19709번 - LunchBox 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.5 초 512 MB23915313065.657%

문제

You are the manager of a restaurant. You prepare N lunch boxes and hope to distribute them to some schools. Suppose there are m schools and assume the ith school asks for ki lunch boxes.

You aim to distribute the lunch boxes to as many schools as possible. Moreover, you have a rule. For the ith school, you give either zero or ki lunch boxes. Can you make a program that help you to find the maximum number of schools that can receive lunch boxes?

입력

Your program must read from standard input. The first line contains 2 integers, N and m. Then, it follows by m lines. The ith line contains an integer ki.

출력

Your program must output one line with a single integer to the standard output, which is the maximum number of schools.

제한

예제 입력 1

10 4
3
9
4
2

예제 출력 1

3

힌트

출처

Olympiad > National Olympiad in Informatics (Singapore) > NOI 2016 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /