eolymp
bolt
Try our new interface for solving problems
Məsələlər

Network Reliability

Network Reliability

Zaman məhdudiyyəti 3 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB

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.

Giriş verilənləri

The first line contains three integers N (1N14), M (0M100) and P (0P100), separated by a single space. N is the number of the vertices and M is the number of the edges. P is the probability represented by a percentage.

_i

The following M lines describe the edges. Each line contains two integers v_i and u_i (1v_i, u_iN). (v_i, u_i) indicates the edge that connects the two vertices u_i and v_i.

Çıxış verilənləri

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 10^{-9} or less.

Nümunə

Giriş verilənləri #1
3 3 50
1 2
2 3
3 1
Çıxış verilənləri #1
0.500000000000
Mənbə Japan Alumni Group Winter Contest 2012