#K75537. Update Employee Skill Ratings

    ID: 34441 Type: Default 1000ms 256MiB

Update Employee Skill Ratings

Update Employee Skill Ratings

You are given the skill ratings of n employees in m different skills. Some ratings might be missing (represented by 0). For each missing rating, you need to replace it with the floor of the average rating (i.e., \(\lfloor\frac{\text{sum of non-zero ratings}}{\text{number of non-zero ratings}}\rfloor\)) among all other employees for that particular skill. If all ratings for a skill are 0, then the missing value remains 0.

Note: The floor of a number is the greatest integer less than or equal to that number.

Input/Output: The problem uses standard input (stdin) and standard output (stdout).

inputFormat

The first line contains two integers n and m representing the number of employees and the number of skills respectively. Each of the next n lines contains m integers where each integer represents the rating for a particular skill. A rating of 0 indicates a missing value.

outputFormat

Output n lines, each containing m integers. Each line represents an employee's updated skill ratings after replacing the zero ratings using the floor average value computed from the other employees' ratings for that skill.

## sample
3 3
0 50 80
60 0 90
70 80 0
65 50 80

60 65 90 70 80 85

</p>