Skip to content

Instantly share code, notes, and snippets.

@Moishe
Created December 10, 2020 13:53
Show Gist options
  • Save Moishe/fd74d2305d746f212b74d383a9a5f6c5 to your computer and use it in GitHub Desktop.
Save Moishe/fd74d2305d746f212b74d383a9a5f6c5 to your computer and use it in GitHub Desktop.
f = open('input.txt')
steps = []
for l in f:
steps.append(int(l.rstrip()))
mx = max(steps) + 3
c = len(steps) + 1
print ("a + 3b = %d" % mx)
print ("a + b = %d" % c)
b = (mx - c) / 2
print ("b = (%d - %d) / 2 = %d" % (mx, c, b))
a = c - b
print ("a = %d - %d = %d" % (c, b, a))
print("Solution: a * b = %d" % (a * b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment