title: Distributing M Items Circle Size N Starting K Th Position
signature: distributingMItemsCircleSizeNStartingKThPosition(n, m, k) {
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(n, m, k, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n, m, k), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          19, 14, 34, 
          9)
      }");
  
      print("TEST-1...${driver(
          23, 51, 5, 
          9)
      }");
  
      print("TEST-2...${driver(
          92, 10, 24, 
          33)
      }");
  
      print("TEST-3...${driver(
          9, 50, 34, 
          2)
      }");
  
      print("TEST-4...${driver(
          20, 67, 20, 
          6)
      }");
  
      print("TEST-5...${driver(
          68, 25, 40, 
          64)
      }");
  
      print("TEST-6...${driver(
          66, 30, 24, 
          53)
      }");
  
      print("TEST-7...${driver(
          77, 22, 32, 
          53)
      }");
  
      print("TEST-8...${driver(
          90, 1, 71, 
          71)
      }");
  
      print("TEST-9...${driver(
          26, 34, 54, 
          9)
      }");
  
      return 0;
  }
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 );
  }