Last active
August 29, 2015 14:01
-
-
Save goyuninfo/6a78b50a4c7492e388d8 to your computer and use it in GitHub Desktop.
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)