title: Find Sum Modulo K First N Natural Number
signature: function findSumModuloKFirstNNaturalNumber($n, $k) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($n, $k, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n, $k), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        11, 5, 
        21));
      
      printf("TEST-1...%s\n",driver(
        36, 69, 
        666));
      
      printf("TEST-2...%s\n",driver(
        71, 28, 
        876));
      
      printf("TEST-3...%s\n",driver(
        74, 1, 
        0));
      
      printf("TEST-4...%s\n",driver(
        66, 84, 
        2211));
      
      printf("TEST-5...%s\n",driver(
        38, 14, 
        237));
      
      printf("TEST-6...%s\n",driver(
        2, 11, 
        3));
      
      printf("TEST-7...%s\n",driver(
        73, 87, 
        2701));
      
      printf("TEST-8...%s\n",driver(
        79, 11, 
        388));
      
      printf("TEST-9...%s\n",driver(
        30, 55, 
        465));
      
  }
  
  main();
  ?>
source_py: def find_sum_modulo_k_first_n_natural_number(N, K):
      ans = 0
      for i in range(1, (N + 1)):
          ans += (i % K)
      return ans
source_cpp: int find_sum_modulo_k_first_n_natural_number(int N, int K) {
    int ans = 0;
    for ( int i = 1;
    i <= N;
    i ++ ) ans += ( i % K );
    return ans;
  }