Skip to content

Instantly share code, notes, and snippets.

@uroybd
Created July 16, 2016 17:34
Show Gist options
  • Save uroybd/3b9c978cc9c4a17b88b3bb7b1bdac82d to your computer and use it in GitHub Desktop.
Save uroybd/3b9c978cc9c4a17b88b3bb7b1bdac82d to your computer and use it in GitHub Desktop.
Triangle
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