# ==============================================================================
"""EUCLID : compute the Euclidian division of two integer numbers"""
# ==============================================================================
__author__  = "Christophe Schlick modified by Philippe Blasi"
__version__ = "5.0" # split code into kernel and interface functions
__date__    = "2022-11-12"
# ==============================================================================
def euclid(x:int,y:int) -> str:
  """return Euclidian decomposition: x = y*q + r"""
  return f"{x} = {y} * {x//y} + {x%y}"
# ------------------------------------------------------------------------------
def parser(command:str) -> str:
  """parse 'command' as two integers 'a,b' and return Euclidian decomposition"""
  a, b = command.split()
  a, b = int(a), int(b)
  return euclid(a, b)
# ------------------------------------------------------------------------------
def loop() -> None:
  """interaction loop for the "euclid" module"""
  print("Note: enter empty line to stop interaction loop\n")
  while True:
    command = input("<> Enter <numerator> <denominator> : ")
    if command == '': break
    print(parser(command))
  print("See you later...")
# ==============================================================================
if __name__ == '__main__': # test whether this code is used as module or program
  loop()
# ==============================================================================
