NPS-INR-Cyber-Programming-2021

The 2021 edition of the NPS Indiranagar interhouse Cyber Programming contest.

View on GitHub

The McAfee Tragedy

Problem Statement:

While McAfee mourned its founder’s death, it was threatened by a group of anonymous hackers that have given them an array A with N integers and an integer K. Solving this array by finding the number of quadruples (i, j, k, l) such that 1 ≤ i < j < k < lN and Ai, Aj, Ak, Al add up to K, will indicate the number of servers that have been infected in their South China Sea cluster.

Your job is to find this number to solve this small piece of the puzzle.

Constraints:

Subtask 1: 20 points

Subtask 2: 30 points

Subtask 3: 50 points

Input Format:

Output Format:

Sample Input:

6 9 1 3 4 2 4 2 

Sample output:

2