题目:

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 nt and sn 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 s 1, …, s nthat define the moments of time at which the gondolas of Anna’s colleagues will appear on the opposite side of the canal. s − t < s 1 < … < s n < 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.

Example

input output
2 60 600
600 630
630.000000
645.000000

思路:水题:ans=(t+s+x)/2;

 #include <bits/stdc++.h>

 using namespace std;

 #define MP make_pair
#define PB push_back
typedef long long LL;
typedef pair<int,int> PII;
const double eps=1e-;
const double pi=acos(-1.0);
const int K=1e6+;
const int mod=1e9+; int n,t,s,x;
int main(void)
{
cin>>n>>t>>s;
for(int i=;i<=n;i++)
scanf("%d",&x),printf("%.6f\n",(s+t+x)/2.0);
return ;
}

URAL - 1902 Neo-Venice的更多相关文章

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

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

  2. ural 2071. Juice Cocktails

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

  3. ural 2073. Log Files

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

  4. ural 2070. Interesting Numbers

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

  5. ural 2069. Hard Rock

    2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...

  6. ural 2068. Game of Nuts

    2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...

  7. ural 2067. Friends and Berries

    2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...

  8. ural 2066. Simple Expression

    2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...

  9. ural 2065. Different Sums

    2065. Different Sums Time limit: 1.0 secondMemory limit: 64 MB Alex is a very serious mathematician ...

随机推荐

  1. MySQL集群系列2:通过keepalived实现双主集群读写分离

    在上一节基础上,通过添加keepalived实现读写分离. 首先关闭防火墙 安装keepalived keepalived 2台机器都要安装 rpm .el6.x86_64/ 注意上面要替换成你的内核 ...

  2. 从客户端检测到有潜在危险的Request.Form 值”错误提示

    http://www.cnblogs.com/UouHt/archive/2008/10/30/1322697.html asp.net开发中,经常遇到“从客户端检测到有潜在危险的Request.Fo ...

  3. MySQL防止重复插入唯一限制的数据 4种方法

    MySQL防止重复插入唯一限制的数据,下面我们逐一分析 : 1.insert ignore into 当插入数据时,如出现错误时,如重复数据,将不返回错误,只以警告形式返回.所以使用ignore请确保 ...

  4. gibhub上搭建个人静态网站介绍

    之前学习过git的基本命令.今天介绍一下github上搭建个人网站的步骤. 在window系统上搭建gibhub个人网站(只能执行html.css和js文件),这就是纯静态页面. 步骤一:注册gith ...

  5. html input accept类型

    在上传文件的时候,需要限制指定的文件类型. <input type="file" accept="image/*" /> accept表示可以上传文 ...

  6. 【Raspberry pi】python ide-spyder

    sudo apt-get install spyder 简单 明了

  7. IntelliJ IDEA2017 java连接mysql数据库并查询数据

    最近自己开始重新学习java基础了,做java开发不可避免要处理数据库,由于好久不写java了,对idea也有点陌生了.所以这里写篇用jdbc来连接mysql的文章 至于mysql怎么装,请自行百度  ...

  8. Lumen rule

    之前写了了laravel表单验证的生命周期:https://www.cnblogs.com/cxscode/p/7561277.html 今天来总结一下lumen的Validator的一些使用心得 可 ...

  9. UIActionSheet样式问题心得

    下午在做一个iPad的项目,需要用到一个 UIActionSheet. 点击popView中的“sort”按钮,触发出一个ActionSheet. self.action = [[[UIActionS ...

  10. 用Java自定义一个定时器

    1.先定义一个监听类: import java.util.Date; import java.util.Timer; import javax.servlet.ServletContextEvent; ...