-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHJ083
25 lines (24 loc) · 786 Bytes
/
HJ083
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
#include <iostream>
using namespace std;
int main() {
int m, n;
while (cin >> m >> n) {
if (m > 9 || n > 9 || m < 1 || n < 1) cout << -1 << endl;
else cout << 0 << endl;
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
if (x1 >= m || x2 >= m || x1 < 0 || x2 < 0 || y1 >= n || y2 >= n || y1 < 0 || y2 < 0 ) cout << -1 << endl;
else cout << 0 << endl;
int x, y;
cin >> x;
if (x < m && x >= 0 && m < 9) cout << 0 << endl;
else cout << -1 << endl;
cin >> y;
if (y < n && y >= 0 && n < 9) cout << 0 << endl;
else cout << -1 << endl;
cin >> x >> y;
if (x < m && y < n && x >= 0 && y >= 0) cout << 0 << endl;
else cout << -1 << endl;
}
return 0;
}