title: Sum Pairwise Products 2
signature: class Solution {
  
      public Double sumPairwiseProducts2(Integer n) {
source_py: def sum_pairwise_products_2(n):
      return ((((n * (n + 1)) * (n + 2)) * ((3 * n) + 1)) / 24)
source_cpp: long long int sum_pairwise_products_2(int n) {
    return n * ( n + 1 ) * ( n + 2 ) * ( 3 * n + 1 ) / 24;
  }
question_info.extension: java
question_info.entry_fn_name: sumPairwiseProducts2
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 1397887.0, "inputs": {"n": 57}}, {"idx": 1, "outputs": 15675.0, "inputs": {"n": 18}}, {"idx": 2, "outputs": 11449977.0, "inputs": {"n": 97}}, {"idx": 3, "outputs": 1155.0, "inputs": {"n": 9}}, {"idx": 4, "outputs": 420497.0, "inputs": {"n": 42}}, {"idx": 5, "outputs": 2645897.0, "inputs": {"n": 67}}, {"idx": 6, "outputs": 3327486.0, "inputs": {"n": 71}}, {"idx": 7, "outputs": 2493271.0, "inputs": {"n": 66}}, {"idx": 8, "outputs": 2972060.0, "inputs": {"n": 69}}, {"idx": 9, "outputs": 15675.0, "inputs": {"n": 18}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Double 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(57, 1397887.0);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(18, 15675.0);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(97, 11449977.0);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(9, 1155.0);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(42, 420497.0);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(67, 2645897.0);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(71, 3327486.0);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(66, 2493271.0);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(69, 2972060.0);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(18, 15675.0);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Double expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Double actual, Double expected){
          return Math.abs(actual - expected) < 1e-09;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__