Limits: 833h20m0s, 512 MB
After Max and Alexis’s initial plan to conquer the world with kitten armies failed, they started a new plan to conquer the kittenland. Currently, there are n cities in the world and m undirected roads which connect two cities. This time, Max and Alexis have placed one cat spy in each of the cities. Two cats can communicate with each other if it is possible to reach the city of one cat starting from the city of the other. Now Max is having fears that “hoomans” might destroy one of the cities so that some pairs of cats cannot communicate with each other. Now Max needs to know the number of pairs of cats who could communicate with each other before but would not be able to do that anymore if a particular city is destroyed. He needs to know this number for every city in the world. So Alexis has imprisoned you, the “hooman” programmer to solve this problem.
This is a companion discussion topic for the original entry at https://toph.co/p/the-spy-cats