#P2466. [SDOI2008] Sue 的小球

    ID: 1472 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>动态规划,dp2008各省省选山东区间 dp

[SDOI2008] Sue 的小球

Description

Sue and Sandy have recently become obsessed with a computer game. The story takes place above a beautiful, mysterious, and thrilling sea. Sue has a small, light boat. However, her goal is not to be a pirate, but to collect colorful eggs floating in the air. Sue has a secret weapon: as long as she rows her boat to a position directly beneath an egg and uses the secret weapon, she can collect that egg instantly. Each egg has a charm value that decreases as the egg falls in the air over time. To score more points, Sue must collect the egg when its charm value is high. If an egg falls into the sea, its charm value becomes a negative number, but that does not dampen Sue's interest, because each egg is unique, and Sue hopes to collect them all.

Sandy is not as romantic as Sue. He wants to get as many points as possible. To solve this, he abstracts the game into the following model:

Approximate the sea surface as the xx-axis and set up a vertical Cartesian coordinate plane. Sue's initial position is on the xx-axis.

Initially there are NN eggs in the air. For the ii-th egg, its initial position is the integer coordinate (xi,yi)(x_{i}, y_{i}). After the game starts, it falls uniformly along the negative yy-axis with speed viv_{i} units of distance per unit time. Sue's initial position is (x0,0)(x_{0}, 0). Sue can move along the positive or negative direction of the xx-axis, at speed 11 unit of distance per unit time. Collecting an egg with the secret weapon is instantaneous, and the score equals one-thousandth of the egg's current yy-coordinate.

Now, Sue and Sandy ask for your help. To satisfy both of their goals, you decide to collect all the eggs while achieving the highest possible total score.

Input Format

The first line contains two integers NN, x0x_{0} separated by a space, representing the number of eggs and Sue's initial position.

The second line contains NN integers xix_{i} separated by spaces. The ii-th number is the initial xx-coordinate of the ii-th egg.

The third line contains NN integers yiy_{i} separated by spaces. The ii-th number is the initial yy-coordinate of the ii-th egg.

The fourth line contains NN integers viv_{i} separated by spaces. The ii-th number is the speed at which the ii-th egg falls uniformly along the negative yy-axis.

Output Format

Output a real number, rounded to three decimal places: the maximum score achievable while collecting all the eggs.

3 0
-4 -2 2
22 30 26
1 9 8

0.000

Hint

For 30% of the testdata, N20N \leq 20.

For 60% of the testdata, N100N \leq 100.

Constraints: for 100% of the testdata, 104xi,yi104-10^4 \leq x_{i}, y_{i} \leq 10^4, 0vi1040 \leq v_{i} \leq 10^4, N1000N \leq 1000.

Translated by ChatGPT 5