Grammy is playing a boring racing game named Easy Gliding. The game's main content is to reach the destination as fast as possible by walking or gliding. The fastest player wins.
Each player controls a character on a two-dimensional plane. A character can walk at any moment with a speed of V1. Especially, when a character touches a gliding point, he/she can glide with a speed of V2for the following 3 seconds. It is guaranteed that V1 Now Grammy locates at point S and she knows the coordinates of all the gliding points p1,p2,…,pn. The goal is to reach point T as fast as possible. Could you tell her the minimum time she has to spend to reach point T? Input The first line contains one integer nn (1≤n≤1000), denoting the number of gliding points. The following nn lines describe the gliding points. The ii-th line contains two integers xi,yixi,yi (1000000≤xi,yi≤1000000), representing the coordinates of the ii-th gliding point pi. The next line contains four integers Sx,Sy,Tx,Ty (−1000000≤Sx,Sy,Tx,Ty≤1000000), representing the coordinates of S and T. The next line contains two integers V1,V2 (1≤V1 Output Output the minimum time Grammy has to spend to reach point TT in one line. Your answer will be considered correct if its absolute or relative error does not exceed 10−6. Examples input output input output input output 解析 :分为三部分:起点,加速点,终点。然后我们求出建图求出 1.起点到每个加速点的时间 2.加速点相互之间的到达所需时间 3.加速点到终点的时间 4.起点直接到终点。 虽然坐标是两个参数,但是我们可以算出两点之间的所需时间,然后用 i 来代表某个点,起点为0,终点为n+1,加速点为1~n,两点的时间其实就是权重,然后利用通常最短路算法计算即可。0.4000000000003.3541019662502.000600000000
C++ Reference: Standard C++ Library reference: C Library: cstdio: fputs
Adobe Photoshop 基本操作
springcloud+nacos+dubbo服务器部署问题
ShareSDK 第三方平台注册指南
经济管理专业必备的15种国内数据库推荐
海外代购系统/代购网站怎么搭建
Stateflow快速入门系列(-):构造并运行 Stateflow 图
Linux 之 Ubuntu 代码开发工具 Visual Studio Code(VSCode) 的安装与一些常用插件配置的简单整理
【已解决】AttributeError: ‘str‘ object has no attribute ‘decode‘(图文教程)