Skip to content

Instantly share code, notes, and snippets.

@flutesa
Created December 9, 2013 16:04
Show Gist options
  • Save flutesa/7874580 to your computer and use it in GitHub Desktop.
Save flutesa/7874580 to your computer and use it in GitHub Desktop.
def isAnswer(w, h, n, m):
return (m//w) * (m//h) >= n
def find(w, h, n):
l = 0
r = 10**18
while l + 1 < r:
m = (l + r)//2
if isAnswer(w, h, n, m):
r = m
else:
l = m
return r
w, h, n = list(map(int, input().split()))
print(find(w, h, n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment