title: Multiply Large Integers Under Large Modulo
signature: fun multiplyLargeIntegersUnderLargeModulo(a: Int, b: Int, mod_arg2: Int): Int {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 48, "inputs": {"a": 60, "b": 24, "mod_arg2": 58}}, {"idx": 1, "outputs": 6, "inputs": {"a": 46, "b": 43, "mod_arg2": 29}}, {"idx": 2, "outputs": 58, "inputs": {"a": 4, "b": 50, "mod_arg2": 71}}, {"idx": 3, "outputs": 1, "inputs": {"a": 67, "b": 1, "mod_arg2": 66}}, {"idx": 4, "outputs": 43, "inputs": {"a": 93, "b": 35, "mod_arg2": 73}}, {"idx": 5, "outputs": 1, "inputs": {"a": 89, "b": 97, "mod_arg2": 8}}, {"idx": 6, "outputs": 19, "inputs": {"a": 8, "b": 78, "mod_arg2": 55}}, {"idx": 7, "outputs": 19, "inputs": {"a": 53, "b": 73, "mod_arg2": 22}}, {"idx": 8, "outputs": 34, "inputs": {"a": 96, "b": 92, "mod_arg2": 83}}, {"idx": 9, "outputs": 25, "inputs": {"a": 38, "b": 64, "mod_arg2": 83}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(a: Int, b: Int, mod_arg2: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(a, b, mod_arg2), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(60, 24, 58, 48)
      println("TEST-0...${result}")
      
      result = driver(46, 43, 29, 6)
      println("TEST-1...${result}")
      
      result = driver(4, 50, 71, 58)
      println("TEST-2...${result}")
      
      result = driver(67, 1, 66, 1)
      println("TEST-3...${result}")
      
      result = driver(93, 35, 73, 43)
      println("TEST-4...${result}")
      
      result = driver(89, 97, 8, 1)
      println("TEST-5...${result}")
      
      result = driver(8, 78, 55, 19)
      println("TEST-6...${result}")
      
      result = driver(53, 73, 22, 19)
      println("TEST-7...${result}")
      
      result = driver(96, 92, 83, 34)
      println("TEST-8...${result}")
      
      result = driver(38, 64, 83, 25)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: multiplyLargeIntegersUnderLargeModulo
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn