题目:

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. WebApi接口传参不再困惑:传参详解

    http://www.cnblogs.com/landeanfen/p/5337072.html

  2. Mysql数据库存储是乱码问题(或者在查询时无法加载数据)

    在连接数据库时添加一行代码即可解决:?useUnicode=true&characterEncoding=utf8 截图如下:

  3. Codeforces 448 C. Painting Fence

    递归.分治. . . C. Painting Fence time limit per test 1 second memory limit per test 512 megabytes input ...

  4. Spring Mvc 上传文件Demo 实例

    返得利购物. 淘宝.京东500家商城合作,包括全面的商城返利网.注冊就送5元,购物就有返利.随时提现. 同学们,新一轮的返利大潮正在慢慢靠近,让购物都认为自己在赚钱.购物,机票.游戏.酒店旅游,地方特 ...

  5. 显示所有APP的进程详细信息(进程ID、进程所在UID、进程占用内存、进程名)

    main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:and ...

  6. 涨姿势UWP源码——IsolatedStorage

    前一篇涨姿势UWP源码分析从数据源着手,解释了RSS feed的获取和解析,本篇则会就数据源的保存和读取进行举例. 和之前的Windows Runtime一样,UWP采用IsolatedStorage ...

  7. Leetcode-Construct Binary Tree from inorder and postorder travesal

    Given inorder and postorder traversal of a tree, construct the binary tree. Solution: /** * Definiti ...

  8. phpstorm 9.0最新 注册码

    phpstorm注册码: User Name:newasp 01.License Key: ===== LICENSE BEGIN ===== 14617-12042010 00001xrVkhnPu ...

  9. 巨蟒python全栈开发数据库前端1:HTML基础

    1.HTML介绍 什么是前端? 前端就是我们打开浏览器的页面.,很多公司都有自己的浏览器的页面,这个阶段学习的就是浏览器界面 比如京东的界面:https://www.jd.com/ 引子 例1 soc ...

  10. Duilib 入门级教程 推荐

    http://www.cnblogs.com/Alberl/category/520438.html 作者写的不错,图文并茂,适合刚入门.