title: Sum Matrix Element Element Integer Division Row Column 1
signature: sumMatrixElementElementIntegerDivisionRowColumn1(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          35, 
          630)
      }");
  
      print("TEST-1...${driver(
          93, 
          4371)
      }");
  
      print("TEST-2...${driver(
          7, 
          28)
      }");
  
      print("TEST-3...${driver(
          81, 
          3321)
      }");
  
      print("TEST-4...${driver(
          80, 
          3240)
      }");
  
      print("TEST-5...${driver(
          47, 
          1128)
      }");
  
      print("TEST-6...${driver(
          7, 
          28)
      }");
  
      print("TEST-7...${driver(
          41, 
          861)
      }");
  
      print("TEST-8...${driver(
          59, 
          1770)
      }");
  
      print("TEST-9...${driver(
          34, 
          595)
      }");
  
      return 0;
  }
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;
  }