Starting from:
$30

$24

With the fall of the Goat and the Serpent


The description provided for this problem:

With the fall of the Goat and the Serpent, Agent Ω hoped that she had finally taken down C.H.I.M.E.R.A., but she soon discovered that the organization had one more head: the Lion, a Martian military commander who had control over the vast automated defenses throughout the solar system.

These defenses included swarms of high-tech wardrones (which the Lion referred to his his "prides") that Agent Ω needed to eliminate before she could go after the Lion directly.  Agent Ω found a glitch in the Wardrones that would allow her to take over a single drone without being detected.  From that drone she can track enegy pulses from nearby drones; she can use this to decode their communication if she can see both drones involved.  But which drone should she take over to scan the most pairs of others?

To decide, she built a graph of which drones would be capable of monitoring each other. Each vertex represents a wardrone, and each edge indicates two that are close enough to track the energy pulses from the other.

You must determine which drone to take over such that Agent Ω can monitor the MOST pairs of drones as they communicate.

Input Format

The first line contains N, the number of wardrones being analyzed, and M, the number of pairs (edges) that could potentially scan each other's energy signatures.
The next M lines each have two values identifying all pairs of wardrones that could scan each other.
Constraints

1 ≤ N ≤ 200
1 ≤ M ≤ 10,000
0 ≤ drone IDs < N
Output Format

Output the count of how many PAIRS of wardrones could both be scanned if the optimal wardrone was taken over.  You should count the wardrone targeted AND all of its neighbors in the graph.

Example 0
Sample Input

5 7
0 1
0 2
0 3
1 2
1 3
1 4
2 3
Sample Output

 10
Explanation

If wardrone 1 is taken over, it will be able to monitor the energy signatures of 0, 2, 3, and 4.

This means that there are 10 pairs that it can monitor the communication of.  Drone 1 can scan four others that it directly communicates with PLUS it can monitor communications between (0,2), (0,3), (0,4), (2,3), (2,4), and (3,4).

More products