title: Sum Matrix Element Absolute Difference Row Column Numbers 1
signature: function sum_matrix_element_absolute_difference_row_column_numbers_1(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(63, 83328);
      @printf("TEST-0...%s\n",result);
      
      result = driver(72, 124392);
      @printf("TEST-1...%s\n",result);
      
      result = driver(28, 7308);
      @printf("TEST-2...%s\n",result);
      
      result = driver(35, 14280);
      @printf("TEST-3...%s\n",result);
      
      result = driver(6, 70);
      @printf("TEST-4...%s\n",result);
      
      result = driver(70, 114310);
      @printf("TEST-5...%s\n",result);
      
      result = driver(20, 2660);
      @printf("TEST-6...%s\n",result);
      
      result = driver(8, 168);
      @printf("TEST-7...%s\n",result);
      
      result = driver(8, 168);
      @printf("TEST-8...%s\n",result);
      
      result = driver(35, 14280);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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;
  }