#t263. 统计数字
统计数字
Counting Numbers
Problem Description
During a scientific survey, natural numbers were obtained, each not exceeding . It is known that there are at most distinct numbers. Now we need to count how many times each natural number appears, and output the statistics in increasing order of the natural numbers.
Input Format
There are lines in total.
The first line is the integer , the number of natural numbers.
Lines through each contain one natural number.
Output Format
There are lines in total ( is the number of distinct numbers among the natural numbers), output in increasing order of the natural numbers. Each line outputs two integers: the natural number and how many times it appears, separated by a single space.
Sample Input
8
2
4
2
4
5
100
2
100
Sample Output
2 3
4 2
5 1
100 2
Hint
- of the data: ;
- of the data: ;
- of the data: , each number not exceeding .
NOIP 2007, improvement group, problem 1.