title: Distributing M Items Circle Size N Starting K Th Position
signature: function distributingMItemsCircleSizeNStartingKThPosition(n: number, m: number, k: number): number {
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.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, m: number, k: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n, m, k),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(19, 14, 34, 9);
    console.log(`TEST-0...${result}`);
  
    result = driver(23, 51, 5, 9);
    console.log(`TEST-1...${result}`);
  
    result = driver(92, 10, 24, 33);
    console.log(`TEST-2...${result}`);
  
    result = driver(9, 50, 34, 2);
    console.log(`TEST-3...${result}`);
  
    result = driver(20, 67, 20, 6);
    console.log(`TEST-4...${result}`);
  
    result = driver(68, 25, 40, 64);
    console.log(`TEST-5...${result}`);
  
    result = driver(66, 30, 24, 53);
    console.log(`TEST-6...${result}`);
  
    result = driver(77, 22, 32, 53);
    console.log(`TEST-7...${result}`);
  
    result = driver(90, 1, 71, 71);
    console.log(`TEST-8...${result}`);
  
    result = driver(26, 34, 54, 9);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: distributingMItemsCircleSizeNStartingKThPosition
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js