Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Integers():
- n = 0
- while True:
- yield n
- n += 1
- def Universe():
- for s in Integers():
- for a in Integers():
- if a>s: break
- for b in Integers():
- if a+b>s: break
- yield a,b,s-a-b
- U = lambda a,b,c: \
- isinstance(a,int) and \
- isinstance(b,int) and \
- isinstance(c,int)
- S0 = lambda a,b,c: \
- U(a,b,c) and \
- a>0 and \
- b>0 and \
- c>0 and ( \
- a == b+c or \
- b == a+c or \
- c == a+b \
- )
- S1 = lambda a,b,c: \
- S0(a,b,c) and \
- S0(b+c,b,c) and \
- S0(abs(b-c),b,c)
- S2 = lambda a,b,c: \
- S1(a,b,c) and \
- S1(a,a+c,c) and \
- S1(a,abs(a-c),c)
- S3 = lambda a,b,c: \
- S2(a,b,c) and \
- S2(a,b,a+b) and \
- S2(a,b,abs(a-b))
- S4 = lambda a,b,c: \
- S3(a,b,c) and \
- a == 65 and ( \
- not S3(b+c,b,c) or \
- not S3(abs(b-c),b,c) \
- )
- for a,b,c in Universe():
- if S4(a,b,c):
- print a,b,c
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement