title: Sum Matrix Element Element Integer Division Row Column 1
signature: function sumMatrixElementElementIntegerDivisionRowColumn1(n: number): number {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 630, "inputs": {"n": 35}}, {"idx": 1, "outputs": 4371, "inputs": {"n": 93}}, {"idx": 2, "outputs": 28, "inputs": {"n": 7}}, {"idx": 3, "outputs": 3321, "inputs": {"n": 81}}, {"idx": 4, "outputs": 3240, "inputs": {"n": 80}}, {"idx": 5, "outputs": 1128, "inputs": {"n": 47}}, {"idx": 6, "outputs": 28, "inputs": {"n": 7}}, {"idx": 7, "outputs": 861, "inputs": {"n": 41}}, {"idx": 8, "outputs": 1770, "inputs": {"n": 59}}, {"idx": 9, "outputs": 595, "inputs": {"n": 34}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(35, 630);
    console.log(`TEST-0...${result}`);
  
    result = driver(93, 4371);
    console.log(`TEST-1...${result}`);
  
    result = driver(7, 28);
    console.log(`TEST-2...${result}`);
  
    result = driver(81, 3321);
    console.log(`TEST-3...${result}`);
  
    result = driver(80, 3240);
    console.log(`TEST-4...${result}`);
  
    result = driver(47, 1128);
    console.log(`TEST-5...${result}`);
  
    result = driver(7, 28);
    console.log(`TEST-6...${result}`);
  
    result = driver(41, 861);
    console.log(`TEST-7...${result}`);
  
    result = driver(59, 1770);
    console.log(`TEST-8...${result}`);
  
    result = driver(34, 595);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: sumMatrixElementElementIntegerDivisionRowColumn1
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js