Frequencies on a board

We have a board with mm rows and nn columns. In each board cell there is a digit (0, ..., 9). Write a program that computes the frequency of each digit in each of the nn columns of the board. The number of rows of a board can be very large.

Input

The input is a series of cases. Each case consists of two integers greater than zero mm and nn denoting, respectively, the number of rows and columns on the board, followed by a row-by-row description of the board’s digits.

Output

For each case in the input, a frequency table. The table has ten rows, respectively representing the digits 0, .., 9 and nn columns. The table value in row dd column jj should be the frequency of digit dd in column jj of the corresponding input board. A blank line appears after the frequency table.

Problem information

Author: Pro1

Generation: 2026-01-25T11:30:01.229Z

© Jutge.org, 2006–2026.
https://jutge.org