title: Sum Pairwise Products 2
signature: sumPairwiseProducts2(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(double actual, double expected){
      return (actual - expected).abs() < 1e-09;
  }
  
  String driver(n, double expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          57, 
          1397887.0)
      }");
  
      print("TEST-1...${driver(
          18, 
          15675.0)
      }");
  
      print("TEST-2...${driver(
          97, 
          11449977.0)
      }");
  
      print("TEST-3...${driver(
          9, 
          1155.0)
      }");
  
      print("TEST-4...${driver(
          42, 
          420497.0)
      }");
  
      print("TEST-5...${driver(
          67, 
          2645897.0)
      }");
  
      print("TEST-6...${driver(
          71, 
          3327486.0)
      }");
  
      print("TEST-7...${driver(
          66, 
          2493271.0)
      }");
  
      print("TEST-8...${driver(
          69, 
          2972060.0)
      }");
  
      print("TEST-9...${driver(
          18, 
          15675.0)
      }");
  
      return 0;
  }
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;
  }