title: Sum Matrix Element Element Integer Division Row Column 1
signature: class Solution {
  
      public Integer sumMatrixElementElementIntegerDivisionRowColumn1(Integer n) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(35, 630);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(93, 4371);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(7, 28);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(81, 3321);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(80, 3240);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(47, 1128);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(7, 28);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(41, 861);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(59, 1770);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(34, 595);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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;
  }