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. MySQL中InnoDB全文检索

    InnoDB存储引擎从1.2.x开始支持全文索引技术,其采用full inverted index的方式.在InnoDB存储引擎中,将(DocumentID,Postition)视为一个ilist.因 ...

  2. ReentrantLock VS synchronized

    ReentrantLock 类实现了 Lock ,它拥有与 synchronized 相同的并发性和内存语义,但是添加了类似锁投票.定时锁等候和可中断锁等候的一些特性. 此外,它还提供了在激烈争用情况 ...

  3. 判断点是否在区域的python实现(射线法)

    #!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2018-10-07 15:49:37 # @Author : Sheldon (thi ...

  4. Redis3.2.8配置参数及说明

    bind 127.0.0.1# 绑定的主机地址,不设置默认将处理所有请求protected-mode yes# 是否开启保护模式,默认开启,要是配置里面没有指定bind和密码,开启该参数后,redis ...

  5. etl接口测试总结

    刚做完一个项目接触到了etl接口,趁还热乎做个总结. etl接口功能测试点总结:1.数据量的检查:目标表与源表数据量是否一致2.字段正确性:拉取源表字段是否为目标表所需要字段(会出现拉错字段情况)3. ...

  6. Android:日常学习笔记(8)———探究UI开发(2)

    Android:日常学习笔记(8)———探究UI开发(2) 对话框 说明: 对话框是提示用户作出决定或输入额外信息的小窗口. 对话框不会填充屏幕,通常用于需要用户采取行动才能继续执行的模式事件. 提示 ...

  7. hadoop02---高可用网站架构

    tomcat每个请求都会占用内存cpu,tomcat没有代理功能.nginx是俄国人写的,nginx是静态资源服务器,既可以自己返回请求,也可以做代理进行转发,和负载均衡.Tomcat是动态资源jav ...

  8. Linux Shell基础 位置参数变量、预定义变量

    位置参数变量 在 Linux 的命令行中,当一条命令或脚本执行时,后面可以跟多个参数,我们使用位置参数变量来表示这些参数.其中,$0 代表命令行本身,$1 代表第 1 个参数,$2 代表第 2 个参数 ...

  9. linux音频 DAPM之二:audio paths与dapm kcontrol

    转:https://blog.csdn.net/wh_19910525/article/details/12749293 在用alsa_amixer controls时,除了我们之前提到的snd_so ...

  10. 个人对于css sprite的一点点见解

    css sprite即CSS雪碧图又称CSS精灵.它存在的一个主要作用就是:减少了网页的http请求次数,从而大大的提高了页面的性能,节省时间和带宽. 例如 这样算下来.CSS sprite真的是个很 ...