[READ-ONLY] Mirror of https://github.com/shuuji3/competitive-programming. 馃洬 Codes submitted to competitive programming platforms
aizu-online-jadge aoj atcoder hackerrank leetcode
0

Configure Feed

Select the types of activity you want to include in your feed.

1r, c = map(int, input().split()) 2table = [] 3for i in range(r): 4 row = list(map(int, input().split())) 5 row.append(sum(row)) 6 table.append(row) 7 8total_row = [] 9for col in range(c+1): 10 column_sum = 0 11 for row in range(r): 12 column_sum += table[row][col] 13 total_row.append(column_sum) 14table.append(total_row) 15 16for i in range(r+1): 17 print(' '.join(map(str, table[i])))