title: Multiply Large Integers Under Large Modulo
signature: multiplyLargeIntegersUnderLargeModulo(a, b, mod_arg2) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(a, b, mod_arg2, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b, mod_arg2), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          60, 24, 58, 
          48)
      }");
  
      print("TEST-1...${driver(
          46, 43, 29, 
          6)
      }");
  
      print("TEST-2...${driver(
          4, 50, 71, 
          58)
      }");
  
      print("TEST-3...${driver(
          67, 1, 66, 
          1)
      }");
  
      print("TEST-4...${driver(
          93, 35, 73, 
          43)
      }");
  
      print("TEST-5...${driver(
          89, 97, 8, 
          1)
      }");
  
      print("TEST-6...${driver(
          8, 78, 55, 
          19)
      }");
  
      print("TEST-7...${driver(
          53, 73, 22, 
          19)
      }");
  
      print("TEST-8...${driver(
          96, 92, 83, 
          34)
      }");
  
      print("TEST-9...${driver(
          38, 64, 83, 
          25)
      }");
  
      return 0;
  }
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;
  }