A. Wizards' Duel

Time Limit: 20 Sec

Memory Limit: 256 MB

题目连接

http://codeforces.com/contest/591/problem/A

Description

Harry Potter and He-Who-Must-Not-Be-Named engaged in a fight to the death once again. This time they are located at opposite ends of the corridor of length l. Two opponents simultaneously charge a deadly spell in the enemy. We know that the impulse of Harry's magic spell flies at a speed of p meters per second, and the impulse of You-Know-Who's magic spell flies at a speed of q meters per second.

The impulses are moving through the corridor toward each other, and at the time of the collision they turn round and fly back to those who cast them without changing their original speeds. Then, as soon as the impulse gets back to it's caster, the wizard reflects it and sends again towards the enemy, without changing the original speed of the impulse.

Since Harry has perfectly mastered the basics of magic, he knows that after the second collision both impulses will disappear, and a powerful explosion will occur exactly in the place of their collision. However, the young wizard isn't good at math, so he asks you to calculate the distance from his position to the place of the second meeting of the spell impulses, provided that the opponents do not change positions during the whole fight.

Input

The first line of the input contains a single integer l (1 ≤ l ≤ 1 000) — the length of the corridor where the fight takes place.

The second line contains integer p, the third line contains integer q (1 ≤ p, q ≤ 500) — the speeds of magical impulses for Harry Potter and He-Who-Must-Not-Be-Named, respectively.

Output

Print a single real number — the distance from the end of the corridor, where Harry is located, to the place of the second meeting of the spell impulses. Your answer will be considered correct if its absolute or relative error will not exceed 10 - 4.

Namely: let's assume that your answer equals a, and the answer of the jury is b. The checker program will consider your answer correct if .

Sample Input

100
50
50

Sample Output

50

HINT

题意

在长度为l的跑道上,左边人的速度是a,右边人的速度是b,然后问你相遇在哪儿

题解:

物理题啦,先算出相遇时间,然后a*t就好了

代码

  1. #include<iostream>
  2. #include<stdio.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. double a,b,c;
  8. cin>>a>>b>>c;
  9. double t = a/(b+c);
  10. printf("%.12lf\n",t*b);
  11. }

Codeforces Round #327 (Div. 2) A. Wizards' Duel 水题的更多相关文章

  1. Codeforces Round #367 (Div. 2) A. Beru-taxi (水题)

    Beru-taxi 题目链接: http://codeforces.com/contest/706/problem/A Description Vasiliy lives at point (a, b ...

  2. Codeforces Round #334 (Div. 2) A. Uncowed Forces 水题

    A. Uncowed Forces Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/pro ...

  3. Codeforces Round #353 (Div. 2) A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/675/problem/A Description Vasya likes e ...

  4. Codeforces Round #146 (Div. 1) A. LCM Challenge 水题

    A. LCM Challenge 题目连接: http://www.codeforces.com/contest/235/problem/A Description Some days ago, I ...

  5. Codeforces Round #335 (Div. 2) B. Testing Robots 水题

    B. Testing Robots Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.codeforces.com/contest/606 ...

  6. Codeforces Round #335 (Div. 2) A. Magic Spheres 水题

    A. Magic Spheres Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.codeforces.com/contest/606/ ...

  7. Codeforces Round #306 (Div. 2) A. Two Substrings 水题

    A. Two Substrings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/550/pro ...

  8. Codeforces Round #188 (Div. 2) A. Even Odds 水题

    A. Even Odds Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/problem/ ...

  9. Codeforces Round #333 (Div. 2) A. Two Bases 水题

    A. Two Bases Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/602/problem/ ...

随机推荐

  1. 【策略】HDOJ-1205-吃糖果

    [题目链接:HDOJ-1205] 思路:直接看题毫无思路... 看了别人的思路,到现在还懵懵懂懂.   只要除了数目最多的糖果以外的其他所有糖果的数目之和加1(小心这里要用int64),大于等于数目最 ...

  2. WdatePicker的一些用法

    在选择日期之后,再执行自己的另一个函数   onpicked: function () { LoadData(); }  <input type="text" class=& ...

  3. ASIHttpRequest编译不通过

    转:http://blog.sina.com.cn/s/blog_67a5e47201014tof.html Undefined symbols for architecture i386:   &q ...

  4. IO的阻塞、非阻塞、同步、异步

  5. NPlot开源画图类

    一.net下的图表控件­­­NPlot的基本用法 NPlot的基本用法 图表控件一直是很难找的,特别是免费又强大的.NPlot是一款非常难得的.Net平台下的图表控件,能做各种曲线图,柱状图,饼图,散 ...

  6. Listview异步加载之优化篇

    异步加载图片基本思想: 1.      先从内存缓存中获取图片显示(内存缓冲) 2.      获取不到的话从SD卡里获取(SD卡缓冲) 3.      都获取不到的话从网络下载图片并保存到SD卡同时 ...

  7. JUC之Atomic系列12大类实例讲解和原理分解

    在java6以后我们不但接触到了Lock相关的锁,也接触到了很多更加乐观的原子修改操作,也就是在修改时我们只需要保证它的那个瞬间是安全的即可,经过相应的包装后可以再处理对象的并发修改,以及并发中的AB ...

  8. Webservice 调用方式整理

    前一段时间搞webservice,简单的记录了一下几种常用的调用方式,供大家参考. 第一种:Java proxy 1).用过eclipse的创建web service client来完成 2).在ec ...

  9. Chapter3:字符串、向量和数组

    C++11新特性:范围for(range for) for (declaration: expression) statement vector和数组都是对象的集合,而引用不是对象. vector对象 ...

  10. ArcMap10.1无法保存编辑的内容

    问题描述:在arcMap10.1中编辑SDE库中要素,保存编辑内容时报错: 无法保存编辑内容.基础DBMS错误[ORA-29877:failed in the execution of the ODC ...