-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_In_the_Dream.cpp
More file actions
132 lines (125 loc) · 2.25 KB
/
A_In_the_Dream.cpp
File metadata and controls
132 lines (125 loc) · 2.25 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
#define FOR(i, n) for (int i = 0; i < n; i++)
#define FOR1(i, n) for (int i = 1; i <= n; i++)
#define f(i, j, n) for (int i = j; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RSORT(x) sort(x.rbegin(), x.rend())
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
#define SUM(x) accumulate(x.begin(), x.end(), 0LL)
#define fm(mp) for (const auto &pair : mp)
void solve()
{
int a, b, c, d;
cin >> a >> b >> c >> d;
bool first = false, sec = false;
c = c - a;
d = d - b;
if (!a)
{
if (b <= 2)
{
// cout << "first";
first = true;
}
}
else if (!b)
{
if (a <= 2)
{
// cout << "sec";
first = true;
}
}
if (b > a)
{
float f = a * 2 + 2;
if (f >= b)
{
// cout << "third";
first = true;
}
}
else
{
float f = b * 2 + 2;
if (f >= a)
{
// cout << "fourth";
first = true;
}
}
a = c;
b = d;
// cout << a << " " << b << " ";
if (!a)
{
if (b <= 2)
{
sec = true;
}
}
else if (!b)
{
if (a <= 2)
{
sec = true;
}
}
if (b > a)
{
float f = a * 2 + 2;
if (f >= b)
{
sec = true;
}
}
else
{
float f = b * 2 + 2;
if (f >= a)
{
sec = true;
}
}
// cout << first << " " << sec;
if (first && sec)
{
cout << "YES";
}
else
{
cout << "NO";
}
cout << "\n";
return;
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--)
{
solve();
}
return 0;
}