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. POCO c++ 使用例子

    .定时器 #include "Poco/Timer.h" #include "Poco/Thread.h" using Poco::Timer; using P ...

  2. java基础—Hashtable,HashMap,TreeMap的差别

    Hashtable : 此类实现一个哈希表,该哈希表将键映射到对应的值.不论什么非null  对象都能够作键值,是线程不同步的 HashMap : 基于哈希表的Map接口的实现.此实现提供全部可选的映 ...

  3. 安装mysql以及修改初始密码

    我们可以采用类似安全模式的方法修改初始密码 先执行命令  mysqld_safe --skip-grant-tables &   (设置成安全模式) &,表示在后台运行,不再后台运行的 ...

  4. orange安装文档

    一.Orange简介    Orange是一个基于 OpenResty/Nginx 的 API Gateway,提供 API 及 “自定义规则” 的监控和管理,如访问统计.流量切分.AB 测试.API ...

  5. ajax跨域资源共享

    一.同域发送数据 略 二.跨域发送数据 1.存在的问题 1.什么是同源策略 同源策略阻止从一个域名上加载的脚本获取或操作另一个域名上的文档属性.也就是说,受到请求的 URL 的域名必须与当前 Web ...

  6. C#对Excel中指定一列或一行实现隐藏或显示!

    C#对Excel中指定一列或一行实现隐藏或显示!不会,求指导!

  7. mssql 中文乱码 字库集 问题解决方法

    The database could not be exclusively locked to perform the operation(SQL Server 5030错误解决办法)   SQL S ...

  8. volume不能挂载mysql permission denied问题

    参考 把玩jenkins docker镜像遇到的volume权限问题 docker run -d -v /root/jenkins:/var/jenkins_home -u 0 -P --name j ...

  9. range开始节点和结束节点

    sc = range.startContainer, so = range.startOffsest ec = range.endContainer, eo=range.endOffset   sta ...

  10. 深入浅出Node.js(下)

    (五):Node.js的异步实现 专栏的第五篇文章<Node.js的异步实现>.之前介绍了Node.js的事件机制,也许读者对此尚会觉得意犹未尽,因为仅仅只是简单的事件机制,并不能道尽No ...