title: Sum Matrix Element Element Integer Division Row Column 1
signature: def sumMatrixElementElementIntegerDivisionRowColumn1(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        35, 
        630    
      )}")   
  
  
      println(s"TEST-1...${driver(
        93, 
        4371    
      )}")   
  
  
      println(s"TEST-2...${driver(
        7, 
        28    
      )}")   
  
  
      println(s"TEST-3...${driver(
        81, 
        3321    
      )}")   
  
  
      println(s"TEST-4...${driver(
        80, 
        3240    
      )}")   
  
  
      println(s"TEST-5...${driver(
        47, 
        1128    
      )}")   
  
  
      println(s"TEST-6...${driver(
        7, 
        28    
      )}")   
  
  
      println(s"TEST-7...${driver(
        41, 
        861    
      )}")   
  
  
      println(s"TEST-8...${driver(
        59, 
        1770    
      )}")   
  
  
      println(s"TEST-9...${driver(
        34, 
        595    
      )}")   
  
  }
  
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;
  }