题目:

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. html 和 javascript 的相关执行顺序

    1.dom 树和 js 的加载顺序 http://blog.csdn.net/jdsxzhao/article/details/44646463 2. jquery中各个事件执行顺序如下: https ...

  2. 【PM面试题】如果让你创业,你会选择什么?

    答案及理由 我会选择可穿戴设备 ,理由有三: 互联网与硬件的结合是未来的大势所趋,通过硬件来采集数据,而通过互联网或者移动互联网将这些设备连接起来,交换数据,让其形成流动的信息. 未来会从卖产品的阶段 ...

  3. Java反射基础(二)

    获取域   1. 通过反射API可以获取到类中公开的静态域和对象中的实例域.得到表示域的java.lang.reflect.Field类的对象之后,就可以获取和设置域的值. 与获取构造方法类似,Cla ...

  4. iOS-layoutSubvies和drawRect何时调用

  5. Eclipse虚拟内存不足【Eclipse中虚拟内存设置】

    Eclipse最近在做J2EE项目中 发现老是出现虚拟内存不足的提示 前2天去加了根内存 问题同样存在 为了让我在写代码时 不在出现那讨厌的内存不足的提示 也为了 不让那破机器再卡住 今天找到了解决方 ...

  6. [MongoDB]学习笔记--User管理

    1. 创建一个超级用户 use admin db.createUser( { user: "adminUserName", pwd: "userPassword" ...

  7. 【BZOJ4260】Codechef REBXOR Trie树+贪心

    [BZOJ4260]Codechef REBXOR Description Input 输入数据的第一行包含一个整数N,表示数组中的元素个数. 第二行包含N个整数A1,A2,…,AN. Output ...

  8. SPOJ Number of Palindromes(回文树)

    Number of Palindromes Time Limit: 100MS   Memory Limit: 1572864KB   64bit IO Format: %lld & %llu ...

  9. SQL server中使用临时表存储数据

    将查询出来的数据直接用“INTO #临时表名称”的方式完成临时表的创建及数据的插入 SELECT * INTO #temp_NowStatusFROM Test SELECT * FROM #temp ...

  10. Fluent Ribbon 第八步 其他控件

    前七节将Ribbon的功能大致介绍了一番,本节来介绍一些特殊控件的使用 DropDownButton控件 当前控件是显示下拉功能的基本组件,其配合Gallery能实现诸多特殊功能,代码如下所示 < ...