Soup Servings

There are two types of soup: type A and type B. Initially, we have n ml of each type of soup. There are four kinds of operations, each equally likely (probability 0.25):

  1. Serve 100 ml of soup A and 0 ml of soup B.
  2. Serve 75 ml of soup A and 25 ml of soup B.
  3. Serve 50 ml of soup A and 50 ml of soup B.
  4. Serve 25 ml of soup A and 75 ml of soup B.

When we serve some soup, we give it to someone and we no longer have it. Each turn we choose one operation. If the total amount of soup is not enough for the chosen operation, we serve whatever we have.

Return the probability that soup A will be empty first, plus half the probability that A and B become empty at the same time. Answers within 10^-5 of the actual answer will be accepted.

Examples
Input: 50
Output: 0.625
Hints

Soup Servings

There are two types of soup: type **A** and type **B**. Initially, we have `n` ml of each type of soup. There are four kinds of operations, each equally likely (probability 0.25):