-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcf1767a.cpp
62 lines (53 loc) · 1002 Bytes
/
cf1767a.cpp
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
// cf1767a
#include <iostream>
#include <string>
#include <utility>
#include <set>
bool solve()
{
std::string s;
std::getline(std::cin, s);
int x;
int y;
std::pair<int, int> A;
std::cin >> x;
std::cin >> y;
A.first = x;
A.second = y;
std::pair<int, int> B;
std::cin >> x;
std::cin >> y;
B.first = x;
B.second = y;
std::pair<int, int> C;
std::cin >> x;
std::cin >> y;
C.first = x;
C.second = y;
std::set<int> horizontal;
horizontal.insert(A.first);
horizontal.insert(B.first);
horizontal.insert(C.first);
if (horizontal.size() == 3)
{
return true;
}
std::set<int> vertical;
vertical.insert(A.second);
vertical.insert(B.second);
vertical.insert(C.second);
if (vertical.size() == 3)
{
return true;
}
return false;
}
int main()
{
int t;
std::cin >> t;
while (t--)
{
std::cout << (solve() ? "YES" : "NO") << "\n";
}
}