title: Sum Matrix Element Element Integer Division Row Column 1
signature: function sum_matrix_element_element_integer_division_row_column_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(35, 630);
      @printf("TEST-0...%s\n",result);
      
      result = driver(93, 4371);
      @printf("TEST-1...%s\n",result);
      
      result = driver(7, 28);
      @printf("TEST-2...%s\n",result);
      
      result = driver(81, 3321);
      @printf("TEST-3...%s\n",result);
      
      result = driver(80, 3240);
      @printf("TEST-4...%s\n",result);
      
      result = driver(47, 1128);
      @printf("TEST-5...%s\n",result);
      
      result = driver(7, 28);
      @printf("TEST-6...%s\n",result);
      
      result = driver(41, 861);
      @printf("TEST-7...%s\n",result);
      
      result = driver(59, 1770);
      @printf("TEST-8...%s\n",result);
      
      result = driver(34, 595);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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;
  }