Soccer
Time limit2sMemory limit128 MB
Given per-interval scoring probabilities for two teams over 18 intervals, compute the probability that at least one team ends with a prime number of goals.
- Level
Medium4 of 10
- Topics
- Probability, Math, Combinatorics
- Solved
- No attempts yet
Problem
Hongjun is watching a soccer match. To make the analysis simpler, divide the 90-minute match into 18 intervals of 5 minutes each. In each interval, team A and team B can each score at most one goal. The probability that team A scores in an interval and the probability that team B scores in an interval are given. Treat the scoring events in the intervals as independent.
Find the probability that, after the match ends, at least one team has scored a prime number of goals.
Input
The first line contains the probability that team A scores in each 5-minute interval, given as an integer percentage.
The second line contains the probability that team B scores in each 5-minute interval, given as an integer percentage.
Both probabilities are integers between 0 and 100, inclusive.
Output
Print the probability that at least one team finishes with a prime number of goals.
An absolute or relative error of at most 10^-6 is accepted.