title: Find Sum Modulo K First N Natural Number 1
signature: fun findSumModuloKFirstNNaturalNumber1(n: Int, k: Int): Int {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 2600, "inputs": {"n": 40, "k": 90}}, {"idx": 1, "outputs": 2530, "inputs": {"n": 46, "k": 64}}, {"idx": 2, "outputs": 1074, "inputs": {"n": 97, "k": 20}}, {"idx": 3, "outputs": 0, "inputs": {"n": 63, "k": 1}}, {"idx": 4, "outputs": 3166, "inputs": {"n": 92, "k": 52}}, {"idx": 5, "outputs": 1345, "inputs": {"n": 60, "k": 35}}, {"idx": 6, "outputs": 1684, "inputs": {"n": 67, "k": 40}}, {"idx": 7, "outputs": 3751, "inputs": {"n": 61, "k": 62}}, {"idx": 8, "outputs": 2311, "inputs": {"n": 74, "k": 61}}, {"idx": 9, "outputs": 1691, "inputs": {"n": 67, "k": 41}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, k: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n, k), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(40, 90, 2600)
      println("TEST-0...${result}")
      
      result = driver(46, 64, 2530)
      println("TEST-1...${result}")
      
      result = driver(97, 20, 1074)
      println("TEST-2...${result}")
      
      result = driver(63, 1, 0)
      println("TEST-3...${result}")
      
      result = driver(92, 52, 3166)
      println("TEST-4...${result}")
      
      result = driver(60, 35, 1345)
      println("TEST-5...${result}")
      
      result = driver(67, 40, 1684)
      println("TEST-6...${result}")
      
      result = driver(61, 62, 3751)
      println("TEST-7...${result}")
      
      result = driver(74, 61, 2311)
      println("TEST-8...${result}")
      
      result = driver(67, 41, 1691)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: findSumModuloKFirstNNaturalNumber1
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn