塔AI (CI翻译)
Little Vasya has received a young builder’s kit. The kit consists of several wooden bars, the lengths of all of them are known. The bars can be put one on the top of the other if their lengths are the same.
小 Vasya 得到了一套年轻建筑师套装。套装中有若干根木棒,所有木棒的长度都是已知的。当木棒长度相同时,可以将它们一根叠放在另一根上面。AI (CI翻译)
Vasya wants to construct the minimal number of towers from the bars. Help Vasya to use the bars in the best way possible.
Vasya 想用这些木棒搭建尽可能少的塔。请帮助 Vasya 以最佳方式使用这些木棒。AI (CI翻译)
Input
输入格式
AI (CI翻译)The first line contains an integer $*N*$ ($1 ≤ *N* ≤ 1000$) — the number of bars at Vasya’s disposal. The second line contains $*N*$ space-separated integers $*l*_{*i*}$ — the lengths of the bars. All the lengths are natural numbers not exceeding $1000$.
第一行包含一个整数 $*N*$($1 ≤ *N* ≤ 1000$),表示 Vasya 拥有的木棒数量。第二行包含 $*N*$ 个以空格分隔的整数 $*l*_{*i}$,表示木棒的长度。所有长度均为不超过 $1000$ 的自然数。AI (CI翻译)
Output
输出格式
AI (CI翻译)In one line output two numbers — the height of the largest tower and their total number. Remember that Vasya should use all the bars.
在一行中输出两个数——最高塔的高度以及塔的总数。注意,Vasya 必须使用所有木棒。AI (CI翻译)
样例
3
1 2 3
1 3
4
6 5 6 7
2 3
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。