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

Polygon

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1520    Accepted Submission(s): 363


Problem Description
  In this problem, you're given a function f(x) = ax^2 + bx + c(x in [l, r]) and a simple polygon. And we need you to figure out the length of f(x) in this polygon.
 

Input
  There are several test cases and the cases end with EOF. For each case:

  The first line contains six integers n (1 <= n <= 20000), a(a != 0), b, c, l and r, which are the total of the points of the polygon and the parameters of the function and these parameters are in the range [-20000, 20000].

  The next n lines contains two integers x and y, which are the coordinate of the point and both of them are in the range[-10^9, 10^9]. We can ensure that there is a edge between i-th point and (i+1)-th point (1 <= i < n) and there is a edge between first point and n-th point.
 

Output
  For each case, output your answer, your answer should rounded to two decimal places.
 

Sample Input
4 1 0 0 -100 100 -10 0 10 0 10 10 -10 10
 

Sample Output
21.52
 

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-04-16 18:15:38, Gzip enabled