Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help modifiying the code in the picture to meet the following the requirements. I also included a picture with the input / output
I need help modifiying the code in the picture to meet the following the requirements. I also included a picture with the inputoutputThe code must print the output just like that. Given a network of n computers, a set of the pairs of computers that are initially connected, and a sequence of steps where connections are destroyed, one by one, calculate the connectivity as defined in the problem specification aboveafter each connection is destroyed. The Input must be read from standard input no file iouse of file io will fail all the test cases and you will get zero: The first line of input contains three space separated integers, n m m x and d d mrepresenting the number of computers in the enemy network, the number of connections between pairs of computers in the enemy network, and the number of those connections which you will destroy, respectively.The computers are numbered through ninclusive, and the connections are numbered through m respectively.The following m lines will each contain a pair of distinct integers, u and v uv n u vrepresenting that computers u and v are connected, initially. Note: we denote the first of these lines as connection the second as connection and so forth.It is guaranteed that each of the pairs listed will be unique pairs;namely, the same two values of u and v will never appear on two different lines as separate connections. Of course, many individual computers will be connected to more than one other computer, so a particular value u may appear on more than one of these m lines.The following d lines will each contain a unique integer in between and minclusive, representing a connection number that getsdestroyed. These will appear in the order that they get destroyed. The Output standard console output: Output d lines of output. The first line should be the initial connectivity of the network. The following d lines should have the connectivity of the network after each connection is destroy, one by one.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started