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

XM Reserves

Time 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
3 3 1 1 3 6 7 9 4 2 8 1 3 3 2 1 3 6 7 9 4 2 8 1 5 5 1.5 4 3 2 9 1 3 4 3 2 8 9 4 3 2 1 2 3 0 1 2 6 3 4 3 1
 

Sample Output
9.000 24.142 17.956
 

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-06-26 19:39:49, Gzip enabled