WEBSITE RETURNED, TUY NHIÊN SỐ LƯỢNG SUBMIT BỊ GIỚI HẠN MỖI NGÀY CÒN RẤT ÍT (UNDER JUDGE0 NEW POLICY, API PROVIDER). Therefore it is very much for you to pay attention TEST CAREFULLY CODE BEFORE SUBMIT.

Total goods, total column of the matrix

Threads: Enter an integer matrix N x M size. Sum of each row, each column of the matrix.
Input: The first line contains 2 n, m separated by spaces. The next n lines each containing m integers separated by spaces.
Output: two lines, the first line contains n numbers, each number is the sum of a row. The second line contains m number, each number is the sum of a column.
For example:

input:
2 2
3 5
1 7
output:
8 8
4 12

You are not logged in? Log in to Submit Now!

2 Comments

Add a Comment