Skip to content

Instantly share code, notes, and snippets.

@deviantfero
Created May 19, 2018 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deviantfero/14d60f1c146e25afa936cb0434e07eab to your computer and use it in GitHub Desktop.
Save deviantfero/14d60f1c146e25afa936cb0434e07eab to your computer and use it in GitHub Desktop.
import sys
for l in sys.stdin:
inp = [int(x) for x in l.split(' ')]
a = int(inp[0] / inp[1]) if inp[1] != 0 else 0
t = 2 * inp[1]
print(inp[0] * t + a * inp[1]**2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment