title: Sum Matrix Element Absolute Difference Row Column Numbers 1
signature: fun sumMatrixElementAbsoluteDifferenceRowColumnNumbers1(n: Int): Int {
source_py: def sum_matrix_element_absolute_difference_row_column_numbers_1(n):
      sum = 0
      for i in range(n):
          sum += (i * (n - i))
      return (2 * sum)
source_cpp: int sum_matrix_element_absolute_difference_row_column_numbers_1(int n) {
    int sum = 0;
    for ( int i = 0;
    i < n;
    i ++ ) sum += i * ( n - i );
    return 2 * sum;
  }
question_info.test_list: [{"idx": 0, "outputs": 83328, "inputs": {"n": 63}}, {"idx": 1, "outputs": 124392, "inputs": {"n": 72}}, {"idx": 2, "outputs": 7308, "inputs": {"n": 28}}, {"idx": 3, "outputs": 14280, "inputs": {"n": 35}}, {"idx": 4, "outputs": 70, "inputs": {"n": 6}}, {"idx": 5, "outputs": 114310, "inputs": {"n": 70}}, {"idx": 6, "outputs": 2660, "inputs": {"n": 20}}, {"idx": 7, "outputs": 168, "inputs": {"n": 8}}, {"idx": 8, "outputs": 168, "inputs": {"n": 8}}, {"idx": 9, "outputs": 14280, "inputs": {"n": 35}}]
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, 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(63, 83328)
      println("TEST-0...${result}")
      
      result = driver(72, 124392)
      println("TEST-1...${result}")
      
      result = driver(28, 7308)
      println("TEST-2...${result}")
      
      result = driver(35, 14280)
      println("TEST-3...${result}")
      
      result = driver(6, 70)
      println("TEST-4...${result}")
      
      result = driver(70, 114310)
      println("TEST-5...${result}")
      
      result = driver(20, 2660)
      println("TEST-6...${result}")
      
      result = driver(8, 168)
      println("TEST-7...${result}")
      
      result = driver(8, 168)
      println("TEST-8...${result}")
      
      result = driver(35, 14280)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: sumMatrixElementAbsoluteDifferenceRowColumnNumbers1
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