You are presented with a network comprising N computers and M wired connections between them. Your objective is to optimize the network's connectivity using precisely K wires from your inventory. The aim is to maximize the number of computers that can be linked together within the given constraints. Your task is to determine and report the size of the largest network that can be formed by establishing these connections.
In the context of this problem, computers are considered connected if they share either a direct or indirect wired connection. It is worth noting that the value of K will always be less than the number of isolated (standalone) networks in the given configuration, and it may even be zero.
Input Format:
The input for this problem consists of the following parameters:
The first line contains three integers separated by a space: N, M, and K, where:
The next M lines, each contain two integers, ai and bi, representing a wired connection between computers with IDs ai and bi.
Output Format:
Your program should output a single integer representing the size of the largest network that can be formed after connecting K wires.
Constraints:
The computers are numbered from 1 to N
The above network consists of four standalone networks ,let say A,B,C and D with computers {1,2} in network A,computers {3,4,5,6} in network B, computers {7,8,9,10} in network C and computers {11,12,13} in network D. Since we are available with 2 wires so we can observe that by simply connecting any computer from network B to any computer in network C and connecting any computer from network C to any computer from network D will maximise the the network area with 11 computers in single network.