标签:nts sequence contains ges win xmlns sed ace port
Description
Natasha is planning an expedition to Mars for nn people. One of the important tasks is to provide food for each participant.
The warehouse has m daily food packages. Each package has some food type aiai.
Each participant must eat exactly one food package each day. Due to extreme loads, each participant must eat the same food type throughout the expedition. Different participants may eat different (or the same) types of food.
Formally, for each participant j Natasha should select his food type bjbj and each day j-th participant will eat one food package of type bj. The values bjbj for different participants may be different.
What is the maximum possible number of days the expedition can last, following the requirements above?
Input
The first line contains two integers nn and mm (1≤n≤100 1≤m≤100) — the number of the expedition participants and the number of the daily food packages available.
The second line contains sequence of integers a1,a2,…,am (1≤ai≤100), where aiai is the type of ii-th food package.
Output
Print the single integer — the number of days the expedition can last. If it is not possible to plan the expedition for even one day, print 0.
Sample Input
4 10
1 5 2 1 1 1 2 5 7 2
2
100 1
1
0
2 5
5 4 3 2 1
1
3 9
42 42 42 42 42 42 42 42 42
3
Hint
In the first example, Natasha can assign type 1 food to the first participant, the same type 11 to the second, type 55 to the third and type 22 to the fourth. In this case, the expedition can last for 2 days, since each participant can get two food packages of his food type (there will be used 44 packages of type 11, two packages of type 22 and two packages of type 55).
In the second example, there are 100100 participants and only 11 food package. In this case, the expedition can‘t last even 11 day.
题目意思:有n个人要去参加火星探险活动,准备了m份的食物,编号相同的属于一种食物,每个人每天都要吃一份食物并且必须一直吃一种食物,要是有人没有食物了就返回。问最后所有人一共可以存活多少天
标签:nts sequence contains ges win xmlns sed ace port
原文地址:https://www.cnblogs.com/wkfvawl/p/9428662.html