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.