-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardWay.cpp
More file actions
31 lines (24 loc) · 812 Bytes
/
hardWay.cpp
File metadata and controls
31 lines (24 loc) · 812 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
#include <iostream>
using namespace std;
int main ()
{
int t;
cin >> t;
while (t--) {
pair<int, int> vert1;
pair<int, int> vert2;
pair<int, int> vert3;
cin >> vert1.first >> vert1.second;
cin >> vert2.first >> vert2.second;
cin >> vert3.first >> vert3.second;
if (vert1.second == vert2.second && vert3.second < vert1.second) {
cout << abs(vert1.first - vert2.first) << "\n";
} else if (vert2.second == vert3.second && vert1.second < vert3.second) {
cout << abs(vert2.first - vert3.first) << "\n";
} else if (vert1.second == vert3.second && vert2.second < vert1.second) {
cout << abs(vert1.first - vert3.first) << "\n";
} else {
cout << 0 << "\n";
}
}
}