URAL 1902 Neo-Venice(简单物理相遇问题)
来源:互联网 发布:软件购买合同范本 编辑:程序博客网 时间:2024/04/30 07:20
1902. Neo-Venice
Time limit: 1.0 second
Memory limit: 64 MB
Memory limit: 64 MB
Mars was the first planet colonized by humans. After a long terraforming process its appearance has changed completely. From the red desert it has become a blue planet covered by water. There was so much water that some of the cities were built not on land, but on stilts over the water. The most famous one was Neo-Venice. There are canals instead of roads and numerous gondolas instead of cars in this city. All this attracts huge crowds of tourists from the Earth to Neo-Venice. The most popular activities among them are boat excursions. Gondolas are steered by young girls who can not only bring tourists through the canals but also tell them about the history of the city or sing a song along the way. Due to their love for the water these girls are called undines.
The undine Anna has just received a license to steer a gondola. Tomorrow she will carry tourists on excursion to the St. Peter's canal. This canal is narrow, but many popular routes are passing through it, so there are always a lot of gondolas. Anna is afraid that her excitement may lead to a crash with another gondola during the excursion. However, all undines are trained to steer the gondola smoothly and with the same speed, so the only threat comes from gondolas sailing in the opposite direction. Anna knows the schedule of her colleagues and when she herself will enter the canal. Now she wants to know exactly when she will encounter other gondolas, in order to be extra careful around them.
Input
The first line of the input contains integers n, t and s. n is the number of undines who will go through the St. Peter’s canal in the opposite direction (1 ≤ n ≤ 100). t is the time needed for the gondola to sail through the entire length of the canal (1 ≤ t ≤ 100). s is the moment of time at which the Anna's gondola will enter the canal (360 ≤ s ≤ 1200). The second line contains integers s1, …, sn that define the moments of time at which the gondolas of Anna’s colleagues will appear on the opposite side of the canal. s − t < s1 < … < sn < s + t.
Output
Output n numbers that are the points of time when Anna will meet her colleagues, with absolute or relative error no more than 10−6. Numbers should be separated with spaces or line feeds.
Sample
2 60 600600 630
630.000000645.000000AC代码:
#include <stdio.h>int main(){int n,t,s,a;double tt;scanf("%d%d%d",&n,&t,&s);while(n--){scanf("%d",&a);tt=(s+t+a)/2.0;printf("%.6lf\n",tt);}return 0;}
0 0
- URAL 1902 Neo-Venice(简单物理相遇问题)
- URAL 1902. Neo-Venice
- 【物理问题】URAL
- URAL - 2105 Alice and Bob are on Bikes 整体处理、相遇问题
- Neo
- NEO
- piotr_ants蚂蚁相遇问题练习
- 【面试总结】机器人相遇问题
- 相遇
- 相遇
- 相遇
- 相遇
- 相遇
- 相遇
- 相遇
- 相遇
- 相遇
- 相遇
- win利用qq快捷键截屏&& dos目录切换和目录列表显示
- HONGJIN2游戏开发中用到的排序算法有很多
- 10分钟,利用canvas画一个小的loading界面
- 网页高度计算
- 快点快点快乐锻炼锻炼
- URAL 1902 Neo-Venice(简单物理相遇问题)
- 创建视图,多表联
- pl sql 学习笔记(四) merge oracle 用法
- java基数排序算法代码下载
- 青铜粉的调制方法
- Socket.setSoTimeout()方法的使用
- 怎么把PDF转换成PPT格式
- struct和typedef struct彻底明白了
- 短信猫不能关闭服务,端口占用,javax.comm.PortInUseException: Port currently owned by org.smslib等问题