SHARE
TWEET

D

tsypko Jun 2nd, 2020 597 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top