Advertisement
serega1112

Diplomas

Jan 21st, 2022
857
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. w, h, n = map(int, input().split())
  2.  
  3.  
  4.  
  5. l = 0
  6. r = max(w, h) * n
  7.  
  8. while r - l > 1:
  9.     mid = l + (r - l) // 2
  10.     if (mid // w) * (mid // h) < n:
  11.         l = mid
  12.     else:
  13.         r = mid
  14.  
  15. print(r)
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement