Description

Maybe you know “San Guo Sha”, but I guess you didn’t hear the game: “Liang Guo Sha”!

Let me introduce this game to you. Unlike “San Guo Sha” with its complicated rules, “Liang Guo Sha” is a simple game, it consists only four cards, two cards named “Sha”, and the other named “Shan”.

Alice and Bob are good friends, and they’re playing “Liang Guo Sha” now.
Everyone has two cards: a “Sha” and a “Shan”. Each round, everyone choose a card of his/her own, and show it together(Just show the selected card, do not need to put it away). If both of them choose “Sha”,
then Alice gets A points,
and Bob loses A points; if both of them choose “Shan”,
then Alice gets B points,
and Bob loses B points; otherwise,
Bob gets C points,
and Alice loses C points.

Both Alice and Bob wants to get points as many as possible, they thought a optimal strategy: Calculating a percentage of choosing card “Sha” in order to ensure that even the opponent uses the optimal strategy, he/she can still get a highest point exceptation.

  

Here is the question, if both Alice and Bob use the optimal strategy to make their points higher, what is the expectation point which Alice can get in a round?

 

Input

Several test case, process to EOF.

  Each test case has only a line, consists three positive integers: A, B, C respectively.

  1 <= A, B, C <= 100000
 

Output

Each test case just need to output one line, the expectation point that Alice can get. Round to 6 decimal points.
 

Sample Input

2 10 4
3 3 3
 

Sample Output

0.200000
0.000000

Hint

In test case 1, both Alice and Bob calculated the best percentage of choosing “Sha”, and the their percentage are the same: 70%.
If Bob do not choose the best percentage, his strategy might be targetd. For example, if Bob choose 100%, then Alice can change her percentage to 100%, Bob might lose many points. Bob is clever, so he won’t do that.

参考题解:http://blog.csdn.net/ivan_zjj/article/details/7927970

AC代码

#include<stdio.h>

int main() {
double a, b, c;
while(scanf("%lf %lf %lf", &a, &b, &c) == 3) {
double ans = (a*b - c*c) / (a + b + 2*c);
printf("%.6lf\n", ans);
}
return 0;
}

HDU 3910 (13.10.31)的更多相关文章

  1. HDU 1232 (13.10.31)

    畅通工程 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submi ...

  2. TMemo.Text 回车键会变成#$D#$A,而非#13#10

    mmoComplain: TMemo;//cxmComplain.Text 会造成回车键 转换成十六进制的字符串 #$D#$A,而非#13#10 //cxmComplain.Text范例:'风发的是' ...

  3. 背水一战 Windows 10 (31) - 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButton, AppBarButton, AppBarToggleButton

    [源码下载] 背水一战 Windows 10 (31) - 控件(按钮类): ButtonBase, Button, HyperlinkButton, RepeatButton, ToggleButt ...

  4. ubuntu 13.10 mono asp.net服务 安装

    ubuntu 13.10 从官方文档http://www.mono-project.com/Mod_mono 可看到 Mod_Mono is an Apache 2.0/2.2/2.4.3 modul ...

  5. ubuntu 13.10 monodevelop3 安装

    版本 ubuntu 13.10 桌面模式默认:unity :文件管理器:nautilus

  6. ubuntu 13.10 svn工具 rabbitvcs 安装

    ubuntu 版本:13.10:桌面模式默认:unity :文件管理器:nautilus

  7. Fix catalyst driver in Ubuntu 13.04 / 13.10

    Fix catalyst driver in Ubuntu 13.04 / 13.10(墙外文章备份) 1. Introduction I found lots of people strugglin ...

  8. ubuntu 13.10 skype登不上问题

    首先打开sources.list sudo gedit /etc/apt/sources.list 如果是13.10添加源: deb http://archive.canonical.com/ubun ...

  9. ubuntu 13.10 Ralink RT3290 无线与蓝牙4.0的驱动安装

    我的本是hp envy15, 蓝牙与无线的型号是Ralink RT3290, 装了Ubuntu 13.10 64bit后,蓝牙无法使用,无线几秒钟就会断开,查知,是因为驱动问题. ## 准备工作 首先 ...

随机推荐

  1. 异步任务 -- FutureTask

    任务提交 之前在分析线程池的时候,提到过 AbstractExecutorService 的实现: public Future<?> submit(Runnable task) { if ...

  2. TRUNCATE can't with condition

    No, TRUNCATE is all or nothing. You can do a DELETE FROM <table> WHERE <conditions> but ...

  3. iOS 9应用开发教程之创建iOS 9项目与模拟器介绍

    iOS 9应用开发教程之创建iOS 9项目与模拟器介绍 编写第一个iOS 9应用 本节将以一个iOS 9应用程序为例,为开发者讲解如何使用Xcode 7.0去创建项目,以及iOS模拟器的一些功能.编辑 ...

  4. 1016 Phone Bills (25)(25 point(s))

    problem A long-distance telephone company charges its customers by the following rules: Making a lon ...

  5. 决策树算法(ID3)

    Day Outlook Temperature Humidity Wind PlayTennis 1 Sunny Hot High Weak No 2 Sunny Hot High Strong No ...

  6. 使用SoapUI测试windows身份验证的webservice

    有个朋友问到用soapui测试wcf服务时如果使用windows身份验证要怎么传输凭据,于是自己试了一下.其实服务端是wcf还是webservice还是webapi都无所谓,关键是windows身份验 ...

  7. WinlogonHack获取系统密码

    实验环境: win03 sp1 Gina.dll与Msgina.dll Gina.dll在NT/2000中交互式的登陆支持是由WinLogon调用Gina.dll实现的,Gina.dll提供了一个交互 ...

  8. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) B. Problems for Round 水题

    B. Problems for Round 题目连接: http://www.codeforces.com/contest/673/problem/B Description There are n ...

  9. wikioi 1078 最小生成树 Kruskal算法

    1078 最小生成树 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 白银 Silver       题目描述 Description 农民约翰被选为他们镇的镇长!他其中一个竞选承诺 ...

  10. ROS知识(10)----smach_viewer的Graph view不能显示状态图

    1.问题 在运行ROS by Example 2--Indigo版本中,运行 smach_viewer,再运行巡逻,命令如下: $ rosrun smach_viewer smach_viewer.p ...