What's Your Tier?

Starting at 2000 points, play 20 games with given win, loss, and draw probabilities; compute the probability of ending in each of five tiers.

Easy3ProbabilityDynamic programmingCombinatoricsImplementationNo attempts yetTime limit2sMemory limit256 MB

Problem

Gyuhwan has recently become hooked on Overwatch. His current rank score is 2000, and he plans to play 20 ranked games today. Before he starts, he wonders how likely he is to end up in Bronze, Silver, Gold, Platinum, or Diamond after those 20 games, based on his win rate so far.

A win gives 50 points and a loss takes away 50 points. A draw leaves the score unchanged. The tier for each rank score is as follows.

  • Bronze: 1000 to 1499
  • Silver: 1500 to 1999
  • Gold: 2000 to 2499
  • Platinum: 2500 to 2999
  • Diamond: 3000 to 3499

All ranges include both endpoints. Find the probability that Gyuhwan is placed in each tier after playing all 20 games.

Input

The first line contains the probability of winning a game WW, the probability of losing LL, and the probability of a draw DD, separated by spaces. Each value is a nonnegative real number, and W+L+D=1W+L+D=1. Each value is given with at most two digits after the decimal point.

Output

Print the probabilities of being placed in Bronze, Silver, Gold, Platinum, and Diamond, in that order, one per line. Print each probability as a real number between 0 and 1, rounded half up at the 9th decimal place so that exactly 8 digits appear after the decimal point.