title: Distributing M Items Circle Size N Starting K Th Position
signature: fun distributingMItemsCircleSizeNStartingKThPosition(n: Int, m: Int, k: Int): Int {
source_py: def distributing_m_items_circle_size_n_starting_k_th_position(n, m, k):
      if (m <= ((n - k) + 1)):
          return ((m + k) - 1)
      m = (m - ((n - k) + 1))
      if ((m % n) == 0):
          return n
      else:
          return (m % n)
source_cpp: int distributing_m_items_circle_size_n_starting_k_th_position(int n, int m, int k) {
    if ( m <= n - k + 1 ) return m + k - 1;
    m = m - ( n - k + 1 );
    return ( m % n == 0 ) ? n : ( m % n );
  }
question_info.test_list: [{"idx": 0, "outputs": 9, "inputs": {"n": 19, "m": 14, "k": 34}}, {"idx": 1, "outputs": 9, "inputs": {"n": 23, "m": 51, "k": 5}}, {"idx": 2, "outputs": 33, "inputs": {"n": 92, "m": 10, "k": 24}}, {"idx": 3, "outputs": 2, "inputs": {"n": 9, "m": 50, "k": 34}}, {"idx": 4, "outputs": 6, "inputs": {"n": 20, "m": 67, "k": 20}}, {"idx": 5, "outputs": 64, "inputs": {"n": 68, "m": 25, "k": 40}}, {"idx": 6, "outputs": 53, "inputs": {"n": 66, "m": 30, "k": 24}}, {"idx": 7, "outputs": 53, "inputs": {"n": 77, "m": 22, "k": 32}}, {"idx": 8, "outputs": 71, "inputs": {"n": 90, "m": 1, "k": 71}}, {"idx": 9, "outputs": 9, "inputs": {"n": 26, "m": 34, "k": 54}}]
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(n: Int, m: Int, k: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n, m, k), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(19, 14, 34, 9)
      println("TEST-0...${result}")
      
      result = driver(23, 51, 5, 9)
      println("TEST-1...${result}")
      
      result = driver(92, 10, 24, 33)
      println("TEST-2...${result}")
      
      result = driver(9, 50, 34, 2)
      println("TEST-3...${result}")
      
      result = driver(20, 67, 20, 6)
      println("TEST-4...${result}")
      
      result = driver(68, 25, 40, 64)
      println("TEST-5...${result}")
      
      result = driver(66, 30, 24, 53)
      println("TEST-6...${result}")
      
      result = driver(77, 22, 32, 53)
      println("TEST-7...${result}")
      
      result = driver(90, 1, 71, 71)
      println("TEST-8...${result}")
      
      result = driver(26, 34, 54, 9)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: distributingMItemsCircleSizeNStartingKThPosition
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