시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 5 0 0 0.000%

문제

N명의 카우보이가 있다. 그런데 1번 카우보이부터 N번 카우보이까지 차례로 총을 쏴 다른 사람을 맞추려 한다. (N번 사람이 총을 쏜 후에는 1번 사람이 총을 쏘게 될 것이다.) 총을 맞은 사람은 죽게 되어서 더 이상 총을 쏘지 못하게 된다. 이렇게 계속 반복을 하다가 1명이 남게 되면 그 사람이 승자가 된다고 한다.

그런데 N명의 사람들은 모두 총을 쏠 수 있는 능력이 다르기 때문에 총을 쏴서 다른 사람을 마출 수 있는 확률이 다르다. 그렇기 때문에 N명의 카우보이는 모두 이러한 확률을 이용하여서 자기가 이길 수 있는 전략을 짜서 자신이 총을 겨눌 사람을 정하게 된다.

N명의 사람들의 총을 쏘는 능력이 주어져 있을 때, 각각의 사람이 최후의 1인이 되는 확률을 구하는 프로그램을 작성하시오.

입력

첫째 줄에 카우보이의 숫자 N(2 ≤ N ≤ 13)이 주어지고 두 번째 줄에는 N개의 정수 Pi (0 ≤ Pi ≤ 100)가 주어진다. Pi는 i번째 사람이 총을 쏴서 다른 사람을 맞추는 확률을 의미한다.

출력

첫째 줄에 N개의 소수 Qi 를 출력한다 Qi는 i번째 사람이 최후의 1인이 될 확률을 의미한다. 절대/상대 오차는 10-2까지 허용한다.

예제 입력 1

2
1 100

예제 출력 1

1.00 99.00

예제 입력 2

3
100 99 98

예제 출력 2

2.00 0.00 98.00

예제 입력 3

3
50 99 100

예제 출력 3

25.38 74.37 0.25

예제 입력 4

3
50 99 99

예제 출력 4

25.38 49.50 25.12

예제 입력 5

3
50 99 98

예제 출력 5

25.63 24.63 49.74
W3sicHJvYmxlbV9pZCI6IjE4MzIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWNlNzRcdWM2YjBcdWJjZjRcdWM3NzQiLCJkZXNjcmlwdGlvbiI6IjxwPk5cdWJhODVcdWM3NTggXHVjZTc0XHVjNmIwXHViY2Y0XHVj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