首页 > 其他 > 详细

CodeForces 312B Archer

时间:2015-07-19 21:29:03      阅读:86      评论:0      收藏:0      [点我收藏+]

Archer

Time Limit: 2000ms
Memory Limit: 262144KB
This problem will be judged on CodeForces. Original ID: 312B
64-bit integer IO format: %I64d      Java class name: (Any)
 
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 技术分享for SmallR while 技术分享 for Zanoes. The one who shoots in the target first should be the winner.

 

Output the probability that SmallR will win the match.

 

Input

A single line contains four integers 技术分享.

 

Output

Print a single real number, the probability that SmallR will win the match.

The answer will be considered correct if the absolute or relative error doesn‘t exceed 10 - 6.

 

Sample Input

Input
1 2 1 2
Output
0.666666666667

Source

 
解题:等比数列求和的极限
 
技术分享
1 #include <bits/stdc++.h>
2 using namespace std;
3 int a,b,c,d;
4 int main(){
5     while(~scanf("%d%d%d%d",&a,&b,&c,&d))
6         printf("%.8f\n",(double)a*d/(a*d+b*c-c*a));
7     return 0;
8 }
View Code

 

CodeForces 312B Archer

原文:http://www.cnblogs.com/crackpotisback/p/4659402.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!