Codeforces Round 107 (Div. 2)
E
Smart Cheater
Codeforces
未评级
原题
← D→
翻译中…

I guess there's not much point in reminding you that Nvodsk winters aren't exactly hot. That increased the popularity of the public transport dramatically. The route of bus $62$ has exactly $*n*$ stops (stop $1$ goes first on its way and stop $*n*$ goes last). The stops are positioned on a straight line and their coordinates are $0 = *x*_{1} < *x*_{2} < ... < *x*_{*n*}$.

翻译中…

Each day exactly $*m*$ people use bus $62$. For each person we know the number of the stop where he gets on the bus and the number of the stop where he gets off the bus. A ticket from stop $*a*$ to stop $*b*$ ($*a* < *b*$) costs $*x*_{*b*} - *x*_{*a*}$ rubles. However, the conductor can choose no more than one segment NOT TO SELL a ticket for. We mean that conductor should choose C and D (С <= D) and sell a ticket for the segments [$*A*$, $*C*$] and [$*D*$, $*B*$], or not sell the ticket at all. The conductor and the passenger divide the saved money between themselves equally. The conductor's "untaxed income" is sometimes interrupted by inspections that take place as the bus drives on some segment of the route located between two consecutive stops. The inspector fines the conductor by $*c*$ rubles for each passenger who doesn't have the ticket for this route's segment.

翻译中…

You know the coordinated of all stops $*x*_{*i*}$; the numbers of stops where the $*i*$-th passenger gets on and off, $*a*_{*i*}$ and $*b*_{*i*}$ ($*a*_{*i*} < *b*_{*i*}$); the fine $*c*$; and also $*p*_{*i*}$ — the probability of inspection on segment between the $*i*$-th and the $*i* + 1$-th stop. The conductor asked you to help him make a plan of selling tickets that maximizes the mathematical expectation of his profit.

翻译中…

Input

翻译中…

The first line contains three integers $*n*$, $*m*$ and $*c*$ ($2 ≤ *n* ≤ 150 000$, $1 ≤ *m* ≤ 300 000$, $1 ≤ *c* ≤ 10 000$).

翻译中…

The next line contains $*n*$ integers $*x*_{*i*}$ ($0 ≤ *x*_{*i*} ≤ 10^{9}$, $*x*_{1} = 0$, $*x*_{*i*} < *x*_{*i* + 1}$) — the coordinates of the stops on the bus's route.

翻译中…

The third line contains $*n* - 1$ integer $*p*_{*i*}$ ($0 ≤ *p*_{*i*} ≤ 100$) — the probability of inspection in percents on the segment between stop $*i*$ and stop $*i* + 1$.

翻译中…

Then follow $*m*$ lines that describe the bus's passengers. Each line contains exactly two integers $*a*_{*i*}$ and $*b*_{*i*}$ ($1 ≤ *a*_{*i*} < *b*_{*i*} ≤ *n*$) — the numbers of stops where the $*i*$-th passenger gets on and off.

翻译中…

Output

翻译中…

Print the single real number — the maximum expectation of the conductor's profit. Your answer will be considered correct if its absolute or relative error does not exceed $10^{ - 6}$.

翻译中…

Namely: let's assume that your answer is $*a*$, and the answer of the jury is $*b*$. The checker program will consider your answer correct, if image.

翻译中…

Note

翻译中…

A comment to the first sample:

翻译中…

The first and third passengers get tickets from stop $1$ to stop $2$. The second passenger doesn't get a ticket. There always is inspection on the segment $1$-$2$ but both passengers have the ticket for it. There never is an inspection on the segment $2$-$3$, that's why the second passenger gets away with the cheating. Our total profit is $(0 + 90 / 2 + 90 / 2) = 90$.

翻译中…

样例

Input #1
3 3 10
0 10 100
100 0
1 2
2 3
1 3
Output #1
90.000000000
InputCopy OutputCopy
Input #2
10 8 187
0 10 30 70 150 310 630 1270 2550 51100
13 87 65 0 100 44 67 3 4
1 10
2 9
3 8
1 5
6 10
2 7
4 10
4 5
Output #2
76859.990000000
InputCopy OutputCopy
题目信息
题号
151E
时间限制
5 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。