title: Sum Matrix Element Element Integer Division Row Column 1
signature: fun sumMatrixElementElementIntegerDivisionRowColumn1(n: Int): Int {
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, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(35, 630)
      println("TEST-0...${result}")
      
      result = driver(93, 4371)
      println("TEST-1...${result}")
      
      result = driver(7, 28)
      println("TEST-2...${result}")
      
      result = driver(81, 3321)
      println("TEST-3...${result}")
      
      result = driver(80, 3240)
      println("TEST-4...${result}")
      
      result = driver(47, 1128)
      println("TEST-5...${result}")
      
      result = driver(7, 28)
      println("TEST-6...${result}")
      
      result = driver(41, 861)
      println("TEST-7...${result}")
      
      result = driver(59, 1770)
      println("TEST-8...${result}")
      
      result = driver(34, 595)
      println("TEST-9...${result}")
      
          
  }
  
  main()
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;
  }