-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6A.cpp
More file actions
22 lines (20 loc) · 735 Bytes
/
6A.cpp
File metadata and controls
22 lines (20 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<bits/stdc++.h>
using namespace std;
void solver(){
int a ,b , c, d;
cin>>a>>b>>c>>d;
//check for the triangle cond of all possible triplets
if((a + b > c && a + c > b && b + c > a) || (b + c > d && c + d > b && b + d > c) || (a + c > d && c + d > a && a + d > c) || (a + b > d && a + d > b && b + d > a)){
cout<<"TRIANGLE";
}
//check for the segment cond of all possible triplets
else if((a + b == c || a + c == b || b + c == a) || (b + c == d || c + d == b || b + d == c) || (a + c == d || c + d == a || a + d == c) || (a + b == d || a + d == b || b + d == a)){
cout<<"SEGMENT";
}
else{
cout<<"IMPOSSIBLE";
}
}
int main(){
solver();
}