F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Water World I

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 618    Accepted Submission(s): 227


Problem Description
  The well known PC game engineer Kevin Flynn designed a new game:Water World I.Player can enters the Virtual World and build the world through this game.
  Jack is the Administrator of Virtual World.He is responsible for water conservation project.Now Kevin gives him an important mission:building a reservoir made with thousands of mountain.

  The design chart of reservoir is very simple.every mountain's width is 1 unit and the hight is Hi numbered from left to right.The valley between two mountains can hold water.
  After the project had been finished,the Virtual World War I broken out.The reservoir is affected by the war,it become tilt.Jack want to know how much water can it hold now.
 

Input
  The input consists of several test cases(about 100).
  For each case,there are two number n,angle in first line.(0<n<=10000,0.0<=|angle|<=80.0).
  when it tilt toward left,angle>0,otherwise,angle<=0.
  Then follow one line there are n integers indicate that the i-th mountain's height is Hi.the mountain starts from left to right.(0<Hi<100000)
 

Output
  For each case print a real number,indicate the maximum of water it can hold. Your answer must be rounded to 2 digits after the decimal point.
 

Sample Input
3 0.0 2 3 1 7 -15.0 1 3 2 5 2 3 4
 

Sample Output
0.00 4.13
 

Author
FZU
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 05:26:50, Gzip enabled