eolymp
bolt
Try our new interface for solving problems
Problems

Zoological experiment

Zoological experiment

Alex is a part of zoological project group and carries out experiments on fluffies. In one experiment, he puts two fluffies in the maze, that basically is an undirected graph. Every second each fluffy selects one of the vertices in the maze, adjacent to the current one, and jumps there. Fluffies select each of the adjacent vertices with equal probability. Although they are in the same maze, they do not interact with each other and move independently. At least, Alex thinks so. To test this hypothesis, he decided to measure how long, on average, a fluffy stays in the same vertex. To avoid errors, Alex averages fraction of a seconds, while fluffy stays in the vertex, for a long period. Alex also believes, that in spite of the fact that fluffies do not interact with each other, they keep the rhythm very precisely, and have been jumping all the time perfectly synchronous. He instructed you to make a theoretical calculations of this value for him. \textbf{Limit} 2 \textit{≤ N ≤ }100 1 \textit{≤ M ≤ }10000 \InputFile The first line contains two integers: N and M --- the number of vertices and edges in the maze. Each of the next M lines contains two integers --- vertex numbers (from 1 to N), connected by an edge. We assume that graph has no loops, parallel edges or isolated vertices. The next line contains two integers from 1 to N --- the numbers of vertices, where fluffies were originally placed. These numbers can match. Fluffies begin to move simultaneously. \OutputFile Print a single number --- the amount of time the fluffy has to stay in the same vertex, in case that Alex’s assumptions were correct.
Time limit 1 second
Memory limit 256 MiB
Input example #1
5 5
1 2
2 3
3 4
4 5
1 5
1 2
Output example #1
0.200000000
Author Евгений Капун
Source Зимняя школа по программированию 2014, Харьков