题目:

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. CI cookie 存放数组

      #ci cookie 由于不能存放数组,所有必须序列化之后在存入数组中 #定义数组 $cookie_array=array( 'shop_id'=>$gid, 'shop_name'=> ...

  2. 使用StringTokenizer分解字符串

    Java切割字符串.一般使用substring.split.StringTokenizer来处理,前两种是String对象的方法,使用字符串能够直接处理,本文介绍下StringTokenizer的使用 ...

  3. EM算法--原理

    EM算法即期望最大化(Expection Maximization)算法,是一种最优化算法,在机器学习领域用来求解含有隐变量的模型的最大似然问题.最大似然是一种求解模型参数的方法,顾名思义,在给定一组 ...

  4. Asp.net控制Tomcat启动关闭的实现方法

    一.场景 近日有个项目客户要求能自己配置相关权限.由于历史原因这个项目采用的是公司以前的权限系统.这个权限系统很强大,不过有个弊端,就是每增加一个权限菜单都要重启才能生效,不然就要等1天它缓存过期后才 ...

  5. boost数据结构tuple

    boost数据结构tuple tuple(元组)定义了一个有固定数目元素的容器,其中每个元素类型可以不相同,这与其它容器有着本质的区别!vector和array虽然可以容纳很多元素,但是元素的类型必须 ...

  6. Python标准库:内置函数delattr(object, name)

    本函数是用来删除对象的属性,比方在函数setattr()里加入的属性,就能够利用这个函数来删除. 參数object是一个对象,參数name是一个字符串,但这个字符串必须是对象的属性.比方delattr ...

  7. IOS开发报错之Undefined symbols for architecture armv6

    本文转载至  http://blog.csdn.net/sanpintian/article/details/7575434 今天在项目中引入SVSegmentedControl.h/.my以及SVS ...

  8. python之range和xrange

    range 前面小节已经说明了,range([start,] stop[, step]),根据start与stop指定的范围以及step设定的步长,生成一个序列. 比如: 1 >>> ...

  9. mysql source 执行sql脚本,中文变量不显示问题或乱码问题

    执行脚本内容如下: SET @pre_version=2017080901; SET @cur_version=2017090401; SET @ver_desc = '测试脚本'; CALL pro ...

  10. [Android]反编译apk + eclipse中调试smali

    从来没有想过反编译apk是来的如此方便,并且还可以修改后重新编译运行,这比在win下修改pe容易多了,感谢apktool和smali工具的作者提供这么好的工具. 跟踪apk一般的做法是在反编译的sma ...