URAL 1902. Neo-venice

Source: Internet
Author: User

1902. Neo-venice
Time limit:1.0 Second
Memory limit:64 MB
Mars is the first planet colonized by humans. After a long terraforming process it appearance has changed completely. From the red desert it had become a blue planet covered by water. There is so much water that some of the cities were built is not on land, but on stilts over the water. The most famous one is Neo-venice. There is canals instead of roads and numerous gondolas instead of cars in the city. All this attracts huge crowds of tourists from the Earth to Neo-venice. The most popular activities among them is boat excursions. Gondolas is steered by young girls who can isn't only bring tourists through the canals but also tell themabout the history Of the city or sing a song along the. Due to their love for the water these girls is called Undines. The Undine Anna has just received a license to steer a gondola. Tomorrow she'll carry tourists on excursion to the St. Peter's Canal. This canal was narrow, but many popular routes was passing through it, so there was always a loT of Gondolas. Anna is afraid this excitement may leads to a crash with another gondola during the excursion. However, all Undines is trained to steer the gondola smoothly and with the same speed, so the only threat comes from Gond Olas sailing in the opposite direction. Anna knows the schedule of hers colleagues and when she herself would enter the canal. Now she wants to know exactly when she'll encounter other gondolas, in order to be extra careful around them. Inputthe first line of the input contains integers N, Tand s. Nis the number of undines who'll go through the St. Peter's canal in the opposite direction (1≤ N≤100). TIs the time needed for the gondola to sail through the entire length of the canal (1≤ T≤100). sIs the moment of time at which the Anna's gondola would enter the canal (360≤ s≤1200). The second line contains integers s1,..., s NThat define the moments of time at which the gondolas of Anna's colleagues would appear on the opposite side of the canal. s? T< s1 < ... < s N< s+ T. Outputoutput NNumbers that is the points of time when Anna would meet her colleagues, with absolute or relative error no more than 10?6. Numbers should is separated with spaces or line feeds. Sample
input Output
2 60 600600 630
630.000000645.000000
problem Author:Denis Dublennykh
problem Source:Ural Championship 2012




Parse: Calculates the time of encounter with n reverse vessels. Direct calculation.



AC Code:

#include <bits/stdc++.h>using namespace Std;int s[102];int main () {    int N, T, S;    scanf ("%d%d%d", &n, &t, &s);    for (int i=0; i<n; i++) scanf ("%d", &s[i]);    for (int i=0; i<n; i++) printf ("%.6lf\n", (double) (S + s[i] + T)/2);    return 0;}


URAL 1902. Neo-venice

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.