/* -*- coding: utf-8 -*- * * 3677.cc: No.3677 Global Checksum - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_H = 1000000; const int MAX_HW = 4000000; /* typedef */ using ui = unsigned int; /* global variables */ ui ss[MAX_H]; /* subroutines */ /* main */ int main() { int h, w; scanf("%d%d", &h, &w); ui t = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { ui aij; scanf("%u", &aij); ss[i] += aij; } t += ss[i]; } for (int i = 0; i < h; i++) printf("%u\n", ss[i] + t); return 0; }