Олимпиадный тренинг

Задача 44942. The sum of positive and negative


Given a two-dimensional array A with dimension NxM. Write a program that adds to the elements of each row such a new element that the sum of the positive elements of the string becomes equal to the modulus of the sum of the negative elements of the string.

Input
The first line of the input contains two space-separated natural numbers N and M ( 0 < N, M <= 25). Next come N lines of M positive integers in each - elements of the matrix A (each element of the matrix does not exceed 105< /sup>).

Imprint
Display the resulting array A of dimension Nx(M+1) on the screen. All elements of a line must be separated by a single space.
 
 
Examples
# Input Output
1 4 5
-10 2 10 -3 4
-5 3 6 -8 8
12 -10 3 -8 4
1 2 3 -1 -2
-10 2 10 -3 4 -3
-5 3 6 -8 8 -4
12 -10 3 -8 4 -1
1 2 3 -1 -2 -3