CodeForces 624A Save Luke神庙大逃亡(暑期小练习)

原创 2016年06月01日 21:05:38

A. Save Luke

Description

LukeSkywalker got locked up in a rubbish shredder between two presses. R2D2 isalready working on his rescue, but Luke needs to stay alive as long aspossible. For simplicity we will assume that everything happens on a straightline, the presses are initially at coordinates 0 and L,and they move towards each other with speed v1 and v2,respectively. Luke has width d andis able to choose any position between the presses. Luke dies as soon as thedistance between the presses is less than his width. Your task is to determinefor how long Luke can stay alive.

Input

Thefirst line of the input contains four integers dLv1v2 (1 ≤ d, L, v1, v2 ≤ 10 000, d < L) —Luke's width, the initial position of the second press and the speed of thefirst and second presses, respectively.

Output

Printa single real value — the maximum period of time Luke can stay alive for.Your answer will be considered correct if its absolute or relative error doesnot exceed 10 - 6.

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

Sample Input

Input

26 2 2

Output

1.00000000000000000000

Input

19 1 2

Output

2.66666666666666650000

Hint

Inthe first sample Luke should stay exactly in the middle of the segment, that isat coordinates [2;4], as the presses movewith the same speed.

Inthe second sample he needs to occupy the position .In this case both presses move to his edges at the same time.

 

题意:

这英文真是看懂了一点尴尬

就是给定角色的体积和速度,怪物移动的速度,以及两者之间的距离,

问这个角色最多活多久。

 

代码:

/*=============================AC情况===============================*/
/*题目网址:   */
/*时间: */
/*心得:  */

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define G 100

int main() {
	int d,l,v1,v2;
	double ans;
	while(scanf("%d%d%d%d",&d,&l,&v1,&v2)!=EOF) {
		ans=double(l-d)/(double)(v1+v2);
		printf("%lf\n",ans);
	}
	return 0;
}

/*********************************测试数据*********************************


**************************************************************************/


版权声明:就这些 Code ,尽管看。PS->只会敲代码的大男孩,是没有女孩子喜欢你的。。。。

相关文章推荐

Codeforces AIM Tech Round (Div. 2) 624A A. Save Luke

A. Save Luke time limit per test1 second memory limit per test256 megabytes inputstandard input ...

Codeforces 653A: Save Luke(简单物理题)

A. Save Luke time limit per test 1 second memory limit per test 256 megabytes input...
  • zugofn
  • zugofn
  • 2016年06月06日 23:42
  • 159

Unity3D 仿神庙逃亡游戏 源码下载

  • 2017年10月05日 14:59
  • 224.29MB
  • 下载

神庙逃亡 介绍 制作思路

DoNews游戏1月23日特稿(记者 子龙)近来,关于神庙逃亡系列的消息接踵而至:神庙逃亡的一代全球总下载量超过1.7亿次;《神庙逃亡2》(原名:Temple Run 2)上架AppStore四天时间...

神庙逃亡

Description 话说最近穷猫猫LKity意外得到了一部ANDROID手机,于是,LKity兴奋地为自己的新机子安装了神往已久的游戏——神庙逃亡(Temple Run)。可惜,LKity不...

神庙逃亡——单纯的物理题

水题

安卓游戏《神庙逃亡2》之技术流高手进阶技巧

今天,你“神庙”了吗?曾经创造1.7亿多次下载神话的跑酷游戏《神庙逃亡》续作《神庙逃亡2》分别于本月17号、24号登陆iOS、Android平台。此前,开发商Imangi工作室(Imangi Stud...

Unity3D 制作“神庙逃亡”吃金币后金币飞出屏幕效果

自己做了一个小的跑酷游戏,单是生硬的吃金币效果不是太好看,所以就像做一个类似于“神庙逃亡”中吃金币后金币飞出屏幕的动态效果。 如图:...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:CodeForces 624A Save Luke神庙大逃亡(暑期小练习)
举报原因:
原因补充:

(最多只允许输入30个字)