Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 1000;
- int n;
- int a[N][N];
- int main(){
- cin >> n;
- for (int i = 0; i < n; i++)
- for (int j = 0; j < n; j++)
- cin >> a[i][j];
- if (n == 2) {
- cout << "1 " << a[0][1] - 1 << endl;
- } else {
- int x = (a[0][1] + a[0][2] - a[1][2]) / 2;
- cout << x;
- for (int i = 1; i < n; i++)
- cout << " " << (a[0][i] - x);
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement