2022. Riding a Toad

Time limit: 1.0 second
Memory limit: 64 MB
A tribe of leafmen live in the old forest. Leafmen are very tiny and fast, that’s why we can’t notice them even when they are under our very nose. Leafmen guard the forest unceasingly, protecting it from evil creatures.
A young leafman Nod has occasionally found out that hostile tribe of boggans is planning to make a raid to leafmen’ palace and kidnap their queen. It’s urgent to warn general Ronin about this to make him send his warriors and tighten security of the palace. Nod whistled for his tame hummingbird, but it didn’t appear, it must have had gone hunting on blackflies. Then Nod saddled up a big toad and rode it towards the general’s garrison.

The garrison is surrounded by a wall with width l. On the height h from the ground the wall has a small cylindrical hole with diameter d. This hole is used by leafmen to get inside flying on hummingbirds. But it’s not an easy thing for a toad to jump into it. Then to draw the guards’ attention Nod decides to take a small stone and throw it into the hole while the toad is jumping. The toad is at distance L from the wall and can make one jump with initial speed (vxvy). At any moment while the toad is in the air and its x coordinate is less than x coordinate of the wall outer surface Nod can throw a stone with an absolute initial speed (uxuy). The stone should fly into the hole not touching its floor or ceiling. Determine the moment when Nod should throw the stone.
You may assume that both the toad and the stone are not affected by any powers except gravity, giving it down-directed acceleration g.

Input

The first line contains integers Lhld (1 ≤ Lhld ≤ 1000). The second line contains integers vxvyuxuy (1 ≤ vxvyuxuy ≤ 1000). X-axis is horizontal and directed towards the wall, Y-axis is up-directed. Let’s assume gravity acceleration equal 10. All distances are given in meters, all speeds in meters per second.

Output

If Nod can throw the stone into the hole output the moment of time when he should throw it with absolute or relative precision 10−6. The moment of the toad’s take-off should be taken as the initial moment. If there are several moments when it is possible to throw the stone output any of them. Your answer should be such that throwing the stone 10−6 second sooner or later it won’t touch the wall. It is guaranteed that if some answer exists then there is the answer satisfying this constraint. If it is not possible to throw the stone into the hole, output “-1”.

Samples

input output
4 2 2 4
1 1 5 10
0.1
30 15 5 5
10 10 20 10
-1
Problem Author: Nick Burlakov
Problem Source: NEERC 2014, Eastern subregional contest
 
 
 

ural 2022 Riding a Toad的更多相关文章

  1. Toad各版本所包含的组件

    Toad for Oracle Base Edition Toad for Oracle Knowledge Xpert for PL/SQL Knowledge Xpert for Oracle A ...

  2. Toad for Sqlserver

    # 设置制表符 从sqlserver拷贝的存储过程粘贴到Toad,代码变得不整齐了,这就需要设置下制表符的大小.

  3. TOAD和PLSQL 默认日期显示、rowid显示、TNSNAME的修改

    先说下要解决的问题: select rowid,acct_id,state_date from acct; 修改后,1)sql指明rowid,可以显示出来 2)时间格式显示为YYYYMMDD HH24 ...

  4. toad的基本操作

    1.把鼠标停在sql所在行,然后ctrl+Enter直接执行当前sql. 2.解决Toad对中文显示乱码问题(如果数据库所在主机的NLS_LANG是AMERICAN_AMERICA.WE8ISO885 ...

  5. URAL 1966 Cycling Roads 点在线段上、线段是否相交、并查集

    F - Cycling Roads     Description When Vova was in Shenzhen, he rented a bike and spent most of the ...

  6. 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome

    题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...

  7. ural 2071. Juice Cocktails

    2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...

  8. ural 2073. Log Files

    2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...

  9. ural 2070. Interesting Numbers

    2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...

随机推荐

  1. SQL 排序的N种方法

    一.手工查询得出名次 select * ,select count(*)+1 from T2 where T2.[成绩] > T1.[成绩] as 名次 from T1 结果:  1 2 3 3 ...

  2. 解决Vue的表格中,expand只有某些行需要展开的问题。

    element UI里的表格里,type="expand"的话,所有行都有展开的选项,然而实际中有些行根据判断不需要展开,而element目前对这个问题还不是很友好,现在有个可以通 ...

  3. python cookbook第三版学习笔记二十:可自定义属性的装饰器

    在开始本节之前,首先介绍下偏函数partial.首先借助help来看下partial的定义 首先来说下第一行解释的意思: partial 一共有三个部分: (1)第一部分也就是第一个参数,是一个函数, ...

  4. 并发 错误 java.lang.IllegalMonitorStateException: current thread not owner 分析

    public class ThreadTest implements Callable<String> { public String call() throws Exception { ...

  5. F110的几个功能

    1.F-59, 没有找到函数, 使用BDC BAPI_ACC_DOCUMENT_POST 必须创建有借贷2 line 的凭证,需求要参考原始的SA类型凭证, 创建一个单条的 科目 = 供应商 的凭证, ...

  6. payload有效载荷(转)

    payload 记载着信息的那部分数据.通常在传输数据时,为了使数据传输更可靠,要把原始数据分批传输,并且在每一批数据的头和尾都加上一定的辅助信息,比如这一批数据量的大小,校验位等,这样就相当于给已经 ...

  7. 1.7 使用电脑测试MC20的发送带中文的短信功能

    需要准备的硬件 MC20开发板 1个 https://item.taobao.com/item.htm?id=562661881042 GSM/GPRS天线 1根 https://item.taoba ...

  8. IMG图片下面出现空格、下边距的解决办法

    放图片的时候总有一个间隔,加上div看,是图片未充满div.最后父级元素加了一个 font-size:0,去掉了间隔. <div class="cut-img" style= ...

  9. PAT 天梯赛 L1-006. 连续因子 【循环】

    题目链接 https://www.patest.cn/contests/gplt/L1-006 思路 输出的连续因子 的乘积 也要是这个数的因子 就每个数先找它的单因子 然后每个单因子往上一个一个遍历 ...

  10. iOS 关于远程推送(push) 的几个问题

    1  push 基本流程原理    (1)启动 app      (2)注册远程通知    (3)苹果服务器回调一个deviceToken "didRegisterForRemoteNoti ...