-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path143A.cpp
More file actions
42 lines (37 loc) · 913 Bytes
/
143A.cpp
File metadata and controls
42 lines (37 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define endl '\n'
int main() {
int x,y,z,w,t,s;
int a,b,c,d;
cin >> z >> w;
cin >> x >> y;
cin >> t >> s;
b = (z-x+s)/2;
c = (s-z+x)/2;
d = (y-z+t)/2;
a = x-c;
if (
z - x + s != y + z - t ||
s - z + x != w + x - t ||
y - z + t != w - x + t ||
z - x + s == s - z + x ||
s - z + x == y - z + t ||
y - z + t == z - x + s ||
z - x + s < 2 || z - x + s > 18 ||
s - z + x < 2 || s - z + x > 18 ||
y - z + t < 2 || y - z + t > 18 ||
a < 1 || a > 9 ||
a == b || a == c || a == d
) {
cout << -1;
}
else{
cout << a <<" " << b<<endl;
cout<< c <<" "<<d<<endl;
}
return 0;
}