Were You Paying Attention?

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

jsumabat wants to test if you were paying attention when he explained counting the number of times an integer appeared in an array. Now, he wants you to demonstrate it in a 2-D array. <-- this was for my summer class lol

CAN YOU CODE

jsumabat will give you an N by N array. For each index in the 2-D array, you are to determine, for each number 1 to N, how many times each number appears.

Input Specification

The first line of input will contain an integer N (1 \le N \le 100).

The next N lines of input will each contain N integers, a_i (1 \le a_i \le N).

Output Specification

For each line i of output where 1 \le i \le N, you are to output how many times the number i appears in the array.

Sample Input

3
1 1 2
3 2 1
2 2 1

Sample Output

4
4
1

Comments

There are no comments at the moment.