

Time Limit: 2 sec / Memory Limit: 256 MiB
配点 : 点
問題文
個の都市があり、 本の道路があります。
番目の道路は、都市 と 都市 を双方向に結んでいます。
同じ つの都市を結ぶ道路は、 本とは限りません。
各都市から他の都市に向けて、何本の道路が伸びているか求めてください。
制約
- 入力は全て整数である。
入力
入力は以下の形式で標準入力から与えられる。
出力
答えを 行に出力せよ。
行目には、都市 から他の都市に向けて、何本の道路が伸びているかを出力せよ。
入力例 1Copy
4 3 1 2 2 3 1 4
出力例 1Copy
2 2 1 1
- 都市 からは 番目と 番目の道路が伸びています。
- 都市 からは 番目と 番目の道路が伸びています。
- 都市 からは 番目の道路が伸びています。
- 都市 からは 番目の道路が伸びています。
入力例 2Copy
2 5 1 2 2 1 1 2 2 1 1 2
出力例 2Copy
5 5
入力例 3Copy
8 8 1 2 3 4 1 5 2 8 3 7 5 2 4 1 6 8
出力例 3Copy
3 3 2 2 2 1 1 2
Score : points
Problem Statement
There are cities and roads. The -th road connects two cities and bidirectionally. There may be more than one road that connects the same pair of two cities. For each city, how many roads are connected to the city?
Constraints
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer in lines. In the -th line , print the number of roads connected to city .
Sample Input 1Copy
4 3 1 2 2 3 1 4
Sample Output 1Copy
2 2 1 1
- City is connected to the -st and -rd roads.
- City is connected to the -st and -nd roads.
- City is connected to the -nd road.
- City is connected to the -rd road.
Sample Input 2Copy
2 5 1 2 2 1 1 2 2 1 1 2
Sample Output 2Copy
5 5
Sample Input 3Copy
8 8 1 2 3 4 1 5 2 8 3 7 5 2 4 1 6 8
Sample Output 3Copy
3 3 2 2 2 1 1 2