title: Distributing M Items Circle Size N Starting K Th Position
signature: pub fn distributing_m_items_circle_size_n_starting_k_th_position(n: i32, m: i32, k: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, m: i32, k: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n, m, k), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        19, 14, 34, 
        9
      ));
      
      println!("TEST-1...{}", driver(
        23, 51, 5, 
        9
      ));
      
      println!("TEST-2...{}", driver(
        92, 10, 24, 
        33
      ));
      
      println!("TEST-3...{}", driver(
        9, 50, 34, 
        2
      ));
      
      println!("TEST-4...{}", driver(
        20, 67, 20, 
        6
      ));
      
      println!("TEST-5...{}", driver(
        68, 25, 40, 
        64
      ));
      
      println!("TEST-6...{}", driver(
        66, 30, 24, 
        53
      ));
      
      println!("TEST-7...{}", driver(
        77, 22, 32, 
        53
      ));
      
      println!("TEST-8...{}", driver(
        90, 1, 71, 
        71
      ));
      
      println!("TEST-9...{}", driver(
        26, 34, 54, 
        9
      ));
      
  }
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 );
  }