Zombies have placed themselves at every junction in Bucharest. Each junction 'i' initially has a presence of ai number of zombies. Every timestep, each zombie randomly chooses one of its neighboring junctions and walks towards it. Each neighboring junction is choosen by the zombie with an equal probability. In order to safegaurd the citizens of Bucharest we need to find out the expected number of zombies at every junction after 'k' timesteps.
The network of Bucharest is given as an edge list.
t - the number of test cases. 't' cases follow.
n, m, k - 'n' junctions (nodes) in Bucharest, 'm' roads (edges) and 'k' time steps.
This is followed by m lines containing 1 edge on each line. Each edge is denoted by 2 integers representing the nodes it connects, which can range from 0 to n-1. All the edges are bidirectional. A node cannot connect itself.
This is followed by n lines, where the ith line contains the initial number of Zombies at the location ai.
Output the number of zombies (rounded of to its nearest integer) in the 5 most highly populated junctions after 'k' timesteps.