Problem Description
Due to the curse made by the devil,Xiao Ming is stranded on a mountain and can hardly escape.
This mountain is pretty strange that its underside is a rectangle which size is
n∗m and every little part has a special coordinate
(x,y)and a height
H.
In order to escape from this mountain,Ming needs to find out the devil and beat it to clean up the curse.
At the biginning Xiao Ming has a fighting will
k,if it turned to
0 Xiao Ming won't be able to fight with the devil,that means failure.
Ming can go to next position
(N,E,S,W)from his current position that time every step,
(abs(H1−H2))/k 's physical power is spent,and then it cost
1 point of will.
Because of the devil's strong,Ming has to find a way cost least physical power to defeat the devil.
Can you help Xiao Ming to calculate the least physical power he need to consume.
Input
T(T≤10), indicating the number of testcases.
Then
T testcases follow.
The first line contains three integers
n,m,k ,meaning as in the title
(1≤n,m≤50,0≤k≤50).
Then the
N ×
M matrix follows.
In matrix , the integer
H meaning the height of
(i,j),and '#' meaning barrier (Xiao Ming can't come to this) .
Then follow two lines,meaning Xiao Ming's coordinate
(x1,y1) and the devil's coordinate
(x2,y2),coordinates is not a barrier.
Output
NoAnswer" otherwise.
(The result should be rounded to 2 decimal places)
Sample Input
Sample Output
广搜