title: Find Sum Modulo K First N Natural Number 1
signature: def findSumModuloKFirstNNaturalNumber1(n: Int, k: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, k: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n, k),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        40, 90, 
        2600    
      )}")   
  
  
      println(s"TEST-1...${driver(
        46, 64, 
        2530    
      )}")   
  
  
      println(s"TEST-2...${driver(
        97, 20, 
        1074    
      )}")   
  
  
      println(s"TEST-3...${driver(
        63, 1, 
        0    
      )}")   
  
  
      println(s"TEST-4...${driver(
        92, 52, 
        3166    
      )}")   
  
  
      println(s"TEST-5...${driver(
        60, 35, 
        1345    
      )}")   
  
  
      println(s"TEST-6...${driver(
        67, 40, 
        1684    
      )}")   
  
  
      println(s"TEST-7...${driver(
        61, 62, 
        3751    
      )}")   
  
  
      println(s"TEST-8...${driver(
        74, 61, 
        2311    
      )}")   
  
  
      println(s"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;
  }