eolymp
bolt
Try our new interface for solving problems
Problems

Network Reliability

Network Reliability

An undirected graph is given. Each edge of the graph disappears with a constant probability. Calculate the probability with which the remained graph is connected. \InputFile The first line contains three integers \textbf{N} (\textbf{1} ≤ \textbf{N} ≤ \textbf{14}), \textbf{M} (\textbf{0} ≤ \textbf{M} ≤ \textbf{100}) and \textbf{P} (\textbf{0} ≤ \textbf{P} ≤ \textbf{100}), separated by a single space. \textbf{N} is the number of the vertices and \textbf{M} is the number of the edges. \textbf{P} is the probability represented by a percentage. _i The following \textbf{M} lines describe the edges. Each line contains two integers \textbf{v_i} and \textbf{u_i} (\textbf{1} ≤ \textbf{v_i}, \textbf{u_i} ≤ \textbf{N}). (\textbf{v_i}, \textbf{u_i}) indicates the edge that connects the two vertices \textbf{u_i} and \textbf{v_i}. \OutputFile Output a line containing the probability with which the remained graph is connected. Your program may output an arbitrary number of digits after the decimal point. However, the absolute error should be \textbf{10^\{-9\}} or less.
Time limit 3 seconds
Memory limit 64 MiB
Input example #1
3 3 50
1 2
2 3
3 1
Output example #1
0.500000000000
Source Japan Alumni Group Winter Contest 2012