Advertisement
tsypko

D

Jun 2nd, 2020
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. const int N = 1000;
  5. int n;
  6. int a[N][N];
  7.  
  8. int main(){
  9.     cin >> n;
  10.     for (int i = 0; i < n; i++)
  11.         for (int j = 0; j < n; j++)
  12.             cin >> a[i][j];
  13.     if (n == 2) {
  14.         cout << "1 " << a[0][1] - 1 << endl;
  15.     } else {
  16.         int x = (a[0][1] + a[0][2] - a[1][2]) / 2;
  17.         cout << x;
  18.         for (int i = 1; i < n; i++)
  19.             cout << " " << (a[0][i] - x);
  20.         cout << endl;
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement