title: Multiply Large Integers Under Large Modulo
signature: multiplyLargeIntegersUnderLargeModulo :: Integer -> Integer -> Integer -> Integer
  multiplyLargeIntegersUnderLargeModulo a b mod_arg2 = 
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 -> Integer -> String
  driver a b mod_arg2 expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME a b mod_arg2) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (60) (24) (58) (48) )
  
      printf "TEST-1...%s\n" (driver (46) (43) (29) (6) )
  
      printf "TEST-2...%s\n" (driver (4) (50) (71) (58) )
  
      printf "TEST-3...%s\n" (driver (67) (1) (66) (1) )
  
      printf "TEST-4...%s\n" (driver (93) (35) (73) (43) )
  
      printf "TEST-5...%s\n" (driver (89) (97) (8) (1) )
  
      printf "TEST-6...%s\n" (driver (8) (78) (55) (19) )
  
      printf "TEST-7...%s\n" (driver (53) (73) (22) (19) )
  
      printf "TEST-8...%s\n" (driver (96) (92) (83) (34) )
  
      printf "TEST-9...%s\n" (driver (38) (64) (83) (25) )
  
source_py: def multiply_large_integers_under_large_modulo(a, b, mod):
      res = 0
      a = (a % mod)
      while b:
          if (b & 1):
              res = ((res + a) % mod)
          a = ((2 * a) % mod)
          b >>= 1
      return res
source_cpp: long long multiply_large_integers_under_large_modulo(long long a, long long b, long long mod) {
    long long res = 0;
    a %= mod;
    while ( b ) {
      if ( b & 1 ) res = ( res + a ) % mod;
      a = ( 2 * a ) % mod;
      b >>= 1;
    }
    return res;
  }