|
||||||||||
XM ReservesTime Limit: 10000/10000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 1053 Accepted Submission(s): 384 Problem Description As an eligible Ingress Resistance Agent you should know your power source, the Exotic Matter. We call it XM, which is the driving force behind all of our actions in Ingress. XM allows us to construct items through hacking portals, to attack enemy portals, make links and create fields. We try to collect XM from the ground. XM concentration come from location based services, meaning that areas with a lot of foot traffic have higher amounts versus places that don't. You can collect XM by moving through those areas. The XM will be automatically harvested by your Scanner when it is within your interaction circle/range. Alice decides to select a location such that she can collect XM as much as possible. To simplify the problem, we consider the city as a grid map with size `n*m' numbered from $(0,0)$ to $(n-1,m-1)$. The XM concentration inside the block $(i,j)$ is $p(i,j)$. The radius of your interaction circle is $r$. We can assume that XM of the block $(i,j)$ are located in the centre of this block. The distance between two blocks is the Euclidean distance between their centres. Alice stands in the centre of one block and collects the XM. For each block with the distance d smaller than r to Alice, and whose XM concertation is $p(i,j)$, Alice's scanner can collects $p(i,j)/(1+d)$ XM from it. Help Alice to determine the maximum XM which she can collect once he stands in the centre of one block. Input There are multiple cases. For each case, the first line consists two integers $n, m~(1\le n,m \le 500)$ and one float-point number $r~(0\le r \le 300)$. Each of the following $n$ line consists $m$ non-negative float-point numbers corresponding to the XM concentrations inside each blocks. Output For each case, output the maximum XM which Alice can collect in one line. Your answers should be rounded to three decimal places. Sample Input
Sample Output
Source | ||||||||||
|