Created
July 28, 2017 08:02
-
-
Save evertlammerts/587a904b5df2c6a2429854c5b0537db1 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
def a(m, f): | |
m, f, g = min(m, f), max(m, f), 0 | |
while f % m != 0: | |
g += f // m | |
m, f = f % m, m | |
g += f // m | |
return (m == 1 and str(g)) or 'impossible' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment