Average X81397


Statement
 

pdf   zip

html

Neo is lost within the different dimensions of the Matrix. To find his way he needs to compute the average intensity of all dimensions in the Matrix. Help Neo complete this task.

Input

The input consists of several test cases. Each test case starts with the number of rows 1≤ n≤ 100, the number of columns 1≤ m≤ 100, and the number of dimensions 1≤ d≤ 100 of the Matrix. This is followed by d· n rows with m integers each, corresponding to the intensities of the d different dimensions.

Output

For each test case, a matrix consisting of the average intensity across all dimensions, rounded to the closest integer.

Public test cases
  • Input

    2 2 2
    1 3
    2 5
    4 7
    1 1
    

    Output

    3 5
    2 3
    
  • Input

    2 3 3
    6 1 3
    7 3 3
    1 3 2
    9 4 3
    6 5 8
    8 2 5
    

    Output

    4 3 4
    8 3 4
    
  • Input

    1 2 5
    4 5
    2 3
    9 7
    6 6
    8 1
    

    Output

    6 4
    
  • Information
    Author
    Anders Jonsson
    Language
    English
    Official solutions
    Unknown.
    User solutions
    C++