title: Distributing M Items Circle Size N Starting K Th Position
signature: function distributing_m_items_circle_size_n_starting_k_th_position(n, m, k)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, m, k, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n, m, k), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(19, 14, 34, 9);
      @printf("TEST-0...%s\n",result);
      
      result = driver(23, 51, 5, 9);
      @printf("TEST-1...%s\n",result);
      
      result = driver(92, 10, 24, 33);
      @printf("TEST-2...%s\n",result);
      
      result = driver(9, 50, 34, 2);
      @printf("TEST-3...%s\n",result);
      
      result = driver(20, 67, 20, 6);
      @printf("TEST-4...%s\n",result);
      
      result = driver(68, 25, 40, 64);
      @printf("TEST-5...%s\n",result);
      
      result = driver(66, 30, 24, 53);
      @printf("TEST-6...%s\n",result);
      
      result = driver(77, 22, 32, 53);
      @printf("TEST-7...%s\n",result);
      
      result = driver(90, 1, 71, 71);
      @printf("TEST-8...%s\n",result);
      
      result = driver(26, 34, 54, 9);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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 );
  }