9027: Best Carry Player

内存限制:128 MB 时间限制:1 S
题面:传统 评测方式:文本比较 上传者:
提交:0 通过:0

题目描述

In real-game situations, instead of simply labeling other units as enemies/allies, there are also priorities between other units. Sometimes you may want to freeze a single enemy rather than some other useless enemies, sometimes freezing/not freezing a unit makes nothing different, or sometimes you may even want to freeze your noob ally in case he does something stupid. Overall, all units are given a score aia_iai (which might be negative, positive, or equal to zero). Your goal is to set up a Time Walk-Chronosphere combo, such that the total score of all units frozen by Chronosphere is maximized. (This value could be zero or even negative, but who could blame you? You already did your best!)

In this problem, you are given the position of Faceless void and all nnn other units.and the scores of each of the nnn units. As the best carry player, you need to compute the maximum total score you can achieve through a Time Walk-Chronosphere combo.

Formally, you are given a two-dimensional point P=(x0,y0), representing the position of Faceless Void. You are also given the parameters r1,r2,R. You are given the information of n other units, where the i-th (1≤i≤n) other unit is at position Qi=(xi,yi), with a score of ai. Then your operation is formally described as.

1. Choose a two dimensional point X such that dist(P,X)≤r, where X represents the position you Time Walk into.
2. Choose a two dimensional point Y such that dist(X,Y)≤r2, where Y represents the position where you cast Chronosphere.
3. Your score is defined as the sum of scores over the set of points in Q1,Q2,…,Qn that is on or inside the circle with radius R, centered at Y

You need to compute the maximum score you can achieve.


输入格式

The first line contains six integers n,r1,r2,R,x0,y0(1n1000,1r1,r2,R109,109x,y109), where n denotes the number of other units, r1,r2 and R are the three parameters, (x0,y0) denotes the initial position P of Faceless Void.
Then a line containing n integers a1,a2,…,an(−109≤ai≤109) follows, denoting the scores of each unit.
Then n lines follow. The i-th (1≤i≤n) line contains two integers xi,yi(−109≤xi,yi≤109), denoting the position QiQ_iQi of the i-th unit. It is guaranteed that Qi are pairwise distinct.

输出格式

0utput an integer in a line, denoting the maximum total score you can achieve through a TimeWalk-Chronosphere combo. textbflIt is quaranteed that the answer of the problem stays the samewhen R is replaced with any R' satisfying R-0.05<R<R+0.05.)

输入样例 复制

1 1 1 1 0 0
1
2 2

输出样例 复制

1

数据范围与提示

输入

4 100 100 100 0 0
-2 3 3 3
0 0
0 10
-10 -10
10 -10

输出

7
示例4

输入

4 10 10 10 14 14
1 1 1 1
7 7
7 -7
-7 7
-7 -7

输出

4