## Description

There are N bugs to be repaired and some engineers whose abilities are roughly equal. And an engineer can repair a bug per day. Each bug has a deadline A[i].

Question: How many engineers can repair all bugs before those deadlines at least?

1<=n<= 1e6. 1<=a[i] <=1e9

## Input Description

There are multiply test cases.

In each case, the first line is an integer N , indicates the number of bugs.

The next line is n integers indicates the deadlines of those bugs.

## Output Description

There are one number indicates the answer to the question in a line for each case.

## Input

4
1 2 3 4


## Output

1


## AC 代码

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
using namespace std;

int a[1000009];
const int maxn = 1e6;
int main()
{
int n,b;
while(~scanf("%d",&n))
{
memset(a,0,sizeof(a));
for(int i=1; i<=n; i++)
{
scanf("%d",&b);
if(b<=maxn)a[b]++;
}
int sum=0,ans=1;
for(int i=1; i<=maxn; i++)
{
sum+=a[i];
int t=((sum-1)/i+1);
ans=max(ans,t);
}
printf("%d\n",ans);
}
return 0;
}