Soccer

Time limit2sMemory limit128 MB

Summary
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.

Examples3

  1. Example 1

    Input
    50
    50
    
    Expected output
    0.5265618908306351
    
  2. Example 2

    Input
    100
    100
    
    Expected output
    0.0
    
  3. Example 3

    Input
    12
    89
    
    Expected output
    0.6772047168840167