title: Find Sum Modulo K First N Natural Number 1
signature: findSumModuloKFirstNNaturalNumber1 :: Integer -> Integer -> Integer
  findSumModuloKFirstNNaturalNumber1 n k = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> Integer -> String
  driver n k expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n k) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (40) (90) (2600) )
  
      printf "TEST-1...%s\n" (driver (46) (64) (2530) )
  
      printf "TEST-2...%s\n" (driver (97) (20) (1074) )
  
      printf "TEST-3...%s\n" (driver (63) (1) (0) )
  
      printf "TEST-4...%s\n" (driver (92) (52) (3166) )
  
      printf "TEST-5...%s\n" (driver (60) (35) (1345) )
  
      printf "TEST-6...%s\n" (driver (67) (40) (1684) )
  
      printf "TEST-7...%s\n" (driver (61) (62) (3751) )
  
      printf "TEST-8...%s\n" (driver (74) (61) (2311) )
  
      printf "TEST-9...%s\n" (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;
  }