Current work
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int x1, x2, x3, y1, y2, y3;
|
||||
cin >> x1 >> y1;
|
||||
cin >> x2 >> y2;
|
||||
cin >> x3 >> y3;
|
||||
|
||||
if (y1 > x1) {
|
||||
swap(&x1, &y1)
|
||||
};
|
||||
int square = -1;
|
||||
|
||||
if (x1 == x2 == x3) {
|
||||
if (y1 + y2 + y3 == x1) {
|
||||
square = x1;
|
||||
}
|
||||
} else if (y1 == y2 == y3) {
|
||||
if (x1 + x2 + x3 == y1) {
|
||||
square = y1;
|
||||
}
|
||||
} else {
|
||||
if (x1 + x2 == x3) {
|
||||
}
|
||||
}
|
||||
|
||||
if (square < 0) {
|
||||
cout << square;
|
||||
return 0;
|
||||
}
|
||||
|
||||
cout << square;
|
||||
}
|
||||
Reference in New Issue
Block a user