title: Basic And Extended Euclidean Algorithms
signature: basicAndExtendedEuclideanAlgorithms :: Integer -> Integer -> Integer
  basicAndExtendedEuclideanAlgorithms a b = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> Integer -> String
  driver a b expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME a b) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (46) (89) (1) )
  
      printf "TEST-1...%s\n" (driver (26) (82) (2) )
  
      printf "TEST-2...%s\n" (driver (40) (12) (4) )
  
      printf "TEST-3...%s\n" (driver (58) (4) (2) )
  
      printf "TEST-4...%s\n" (driver (25) (44) (1) )
  
      printf "TEST-5...%s\n" (driver (2) (87) (1) )
  
      printf "TEST-6...%s\n" (driver (8) (65) (1) )
  
      printf "TEST-7...%s\n" (driver (21) (87) (3) )
  
      printf "TEST-8...%s\n" (driver (82) (10) (2) )
  
      printf "TEST-9...%s\n" (driver (17) (61) (1) )
  
source_py: def basic_and_extended_euclidean_algorithms(a, b):
      if (a == 0):
          return b
      return basic_and_extended_euclidean_algorithms((b % a), a)
source_cpp: int basic_and_extended_euclidean_algorithms(int a, int b) {
    if ( a == 0 ) return b;
    return basic_and_extended_euclidean_algorithms ( b % a, a );
  }