codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

312B.md (1042B)


      1 Source: https://codeforces.com/problemset/problem/312/B
      2 
      3 B. Archer
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the target in turns, and SmallR shoots first. The probability of shooting the target each time is ![](https://espresso.codeforces.com/a7487d7e62f90136b78ae3fbf0a008396f146e13.png) for SmallR while ![](https://espresso.codeforces.com/c443c7703e51f03d0eece0b96b9e84e425878209.png) for Zanoes. The one who shoots in the target first should be the winner.
     22 
     23 Output the probability that SmallR will win the match.
     24 
     25 Input
     26 
     27 A single line contains four integers ![](https://espresso.codeforces.com/488158367221f441ba94b9475c03436069df2a7e.png).
     28 
     29 Output
     30 
     31 Print a single real number, the probability that SmallR will win the match.
     32 
     33 The answer will be considered correct if the absolute or relative error doesn't exceed 10- 6.
     34 
     35 Examples
     36 
     37 Input
     38 
     39 ```
     40 1 2 1 2
     41 ```
     42 
     43 Output
     44 
     45 ```
     46 0.666666666667
     47 ```