title: Multiply Large Integers Under Large Modulo
signature: function multiply_large_integers_under_large_modulo(a, b, mod_arg2)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(a, b, mod_arg2, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(a, b, mod_arg2), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(60, 24, 58, 48);
      @printf("TEST-0...%s\n",result);
      
      result = driver(46, 43, 29, 6);
      @printf("TEST-1...%s\n",result);
      
      result = driver(4, 50, 71, 58);
      @printf("TEST-2...%s\n",result);
      
      result = driver(67, 1, 66, 1);
      @printf("TEST-3...%s\n",result);
      
      result = driver(93, 35, 73, 43);
      @printf("TEST-4...%s\n",result);
      
      result = driver(89, 97, 8, 1);
      @printf("TEST-5...%s\n",result);
      
      result = driver(8, 78, 55, 19);
      @printf("TEST-6...%s\n",result);
      
      result = driver(53, 73, 22, 19);
      @printf("TEST-7...%s\n",result);
      
      result = driver(96, 92, 83, 34);
      @printf("TEST-8...%s\n",result);
      
      result = driver(38, 64, 83, 25);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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;
  }