Created
July 16, 2016 17:34
-
-
Save uroybd/3b9c978cc9c4a17b88b3bb7b1bdac82d to your computer and use it in GitHub Desktop.
Triangle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations | |
def ifTri (a, b, c): | |
if a + b > c and b + c > a and c + a > b: | |
return True | |
else: | |
return False | |
inp = input().split(" ") | |
pool = [] | |
for i in inp: | |
pool.append(int(i)) | |
possible = False | |
for comb in combinations(pool, 3): | |
if ifTri(*comb): | |
possible = True | |
break | |
if possible: | |
print("S") | |
else: | |
print("N") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment