title: Find Sum Modulo K First N Natural Number 1
signature: pub fn find_sum_modulo_k_first_n_natural_number_1(n: 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, k: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n, k), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        40, 90, 
        2600
      ));
      
      println!("TEST-1...{}", driver(
        46, 64, 
        2530
      ));
      
      println!("TEST-2...{}", driver(
        97, 20, 
        1074
      ));
      
      println!("TEST-3...{}", driver(
        63, 1, 
        0
      ));
      
      println!("TEST-4...{}", driver(
        92, 52, 
        3166
      ));
      
      println!("TEST-5...{}", driver(
        60, 35, 
        1345
      ));
      
      println!("TEST-6...{}", driver(
        67, 40, 
        1684
      ));
      
      println!("TEST-7...{}", driver(
        61, 62, 
        3751
      ));
      
      println!("TEST-8...{}", driver(
        74, 61, 
        2311
      ));
      
      println!("TEST-9...{}", driver(
        67, 41, 
        1691
      ));
      
  }
source_py: def find_sum_modulo_k_first_n_natural_number_1(N, K):
      ans = 0
      y = (N / K)
      x = (N % K)
      ans = ((((K * (K - 1)) / 2) * y) + ((x * (x + 1)) / 2))
      return int(ans)
source_cpp: int find_sum_modulo_k_first_n_natural_number_1(int N, int K) {
    int ans = 0;
    int y = N / K;
    int x = N % K;
    ans = ( K * ( K - 1 ) / 2 ) * y + ( x * ( x + 1 ) ) / 2;
    return ans;
  }