logo AlgoBeat OnlineJudge
登录 注册

#213765. [NOISG 2016] LunchBox

内存限制:128 MiB 时间限制:500 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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

You aim to distribute the lunch boxes to as many schools as possible. Moreover, you have a rule. For the th school, you give either zero or 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, and . Then, it follows by lines. The th line contains an integer .

输出格式

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

数据范围与提示

Sample Explanation

In this example, the answer is since and .

Subtasks

The maximum execution time on each instance is . Your program will be tested on sets of input instances that satisfies the following restrictions:

Subtask Marks Restrictions
1 20 Each instance satisfies , and
2 30 Each instance satisfies , and
3 50 Each instance satisfies , and