title: Sum Matrix Element Element Integer Division Row Column 1
signature: sumMatrixElementElementIntegerDivisionRowColumn1 :: Integer -> Integer
  sumMatrixElementElementIntegerDivisionRowColumn1 n = 
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 -> String
  driver n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (35) (630) )
  
      printf "TEST-1...%s\n" (driver (93) (4371) )
  
      printf "TEST-2...%s\n" (driver (7) (28) )
  
      printf "TEST-3...%s\n" (driver (81) (3321) )
  
      printf "TEST-4...%s\n" (driver (80) (3240) )
  
      printf "TEST-5...%s\n" (driver (47) (1128) )
  
      printf "TEST-6...%s\n" (driver (7) (28) )
  
      printf "TEST-7...%s\n" (driver (41) (861) )
  
      printf "TEST-8...%s\n" (driver (59) (1770) )
  
      printf "TEST-9...%s\n" (driver (34) (595) )
  
source_py: def sum_matrix_element_element_integer_division_row_column_1(n):
      ans = 0
      temp = 0
      for i in range(1, (n + 1)):
          if (temp < n):
              temp = (i - 1)
              num = 1
              while (temp < n):
                  if ((temp + i) <= n):
                      ans += (i * num)
                  else:
                      ans += ((n - temp) * num)
                  temp += i
                  num += 1
      return ans
source_cpp: int sum_matrix_element_element_integer_division_row_column_1(int n) {
    int ans = 0, temp = 0, num;
    for ( int i = 1;
    i <= n && temp < n;
    i ++ ) {
      temp = i - 1;
      num = 1;
      while ( temp < n ) {
        if ( temp + i <= n ) ans += ( i * num );
        else ans += ( ( n - temp ) * num );
        temp += i;
        num ++;
      }
    }
    return ans;
  }