title: Sum Matrix Element Element Integer Division Row Column 1
signature: pub fn sum_matrix_element_element_integer_division_row_column_1(n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        35, 
        630
      ));
      
      println!("TEST-1...{}", driver(
        93, 
        4371
      ));
      
      println!("TEST-2...{}", driver(
        7, 
        28
      ));
      
      println!("TEST-3...{}", driver(
        81, 
        3321
      ));
      
      println!("TEST-4...{}", driver(
        80, 
        3240
      ));
      
      println!("TEST-5...{}", driver(
        47, 
        1128
      ));
      
      println!("TEST-6...{}", driver(
        7, 
        28
      ));
      
      println!("TEST-7...{}", driver(
        41, 
        861
      ));
      
      println!("TEST-8...{}", driver(
        59, 
        1770
      ));
      
      println!("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;
  }