def divide(x, y):
  """ Idiomatic / Pythonic recursive division with remainder """
  if x == 0:
    return (0,0)
  
  q, r = divide(x / 2, y)
  q *= 2
  r *= 2
  
  if x & 1:
    r += 1
  
  if r >= y:
    r -= y
    q += 1
  return (q,r)