def rational_to_contfrac(x, y):
  """
  Convert Rational to Continued Fraction
  Args:
    x: numerator
    y: denominator
  Return: x/y as Continued Fraction
  """
  pquotients = []
  while x % y != 0:
    a = x // y
    pquotients += [a]
    x, y = y, x - a * y
  pquotients += [x // y]
  return pquotients