Skip to content

Instantly share code, notes, and snippets.

@goyuninfo
Last active August 29, 2015 14:01
Show Gist options
  • Save goyuninfo/6a78b50a4c7492e388d8 to your computer and use it in GitHub Desktop.
Save goyuninfo/6a78b50a4c7492e388d8 to your computer and use it in GitHub Desktop.
for a in range(1,333):
blimit=int((1000-a)/2)
for b in range(a,blimit):
c=1000-a-b
if a*b+1000*c==500000:
print(a*b*c)
break
@goyuninfo
Copy link
Author

aa+bb=cc
a+b+c=1000
aa+bb+cc+2ab+2ac+2bc=1000000
2cc+2ab+2ac+2bc=1000000
cc+ab+ac+bc=500000
ab+1000c=500000
ab+1000(1000-a-b)=500000
ab+1000000-1000a-1000b=500000
1000a+1000b=ab+500000
ab=1000a+1000b-500000
ab=1000(500-c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment