| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 2 | 2 | 2 | 100.000% |
An emergency happened in one secret organization. In the middle of the working day, one of the employees was hospitalized with symptoms of an extremely dangerous colonavirus infection. In this regard, the management of the organization wants to establish which employees can still be infected, but the symptoms of the disease have not yet shown themselves.
There are $n$ employees in the organization, who can be numbered with integers from 1ドル$ to $n$. From the recordings of CCTV cameras, the organization's management established when which employees contacted each other. In addition, management took into account the following assumptions:
A chronological list of employees' contacts is given. Determine for each employee the probability of being infected according to the assumptions described above.
The first line contains three integers $n,ドル $k$ and $m$ --- the number of employees, the number of the infected employee and the number of contacts, respectively (2ドル \le n \le 15,ドル 1ドル \le k \le n,ドル 1ドル \le m \le 50$).
The $i$-th of the following $m$ lines contains two integers $x_i$ and $y_i$ --- indexes of employees who participated in the $i$-th contact (1ドル \le x_i, y_i \le n,ドル $x_i \ne y_i$).
All contacts in the list are given in chronological order
Print $n$ lines. On the $i$-th line print the probability of infection of the $i$-th employee as an irreducible fraction $a/b$. See the example for a more precise understanding.
3 2 1 1 2
2/3 1/1 0/1
3 2 2 1 2 2 3
1/2 1/1 5/8
4 1 4 1 2 2 3 3 4 4 1
1/1 19/37 17/37 27/37