|
||||||||||
PepperLa's ExpressTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 32 Accepted Submission(s): 11 Problem Description PepperLa's City is a three-dimensional city whose size is $(Z*X*Y)$. PepperLa Express is the only express in the city. The company has set up several delivery station in the city, and users will choose the nearest one. PepperLa's vehicle is poor, it can only travel along the $Z, X, Y$ axis at the speed of one unit length per day. Because many users complained about the delivery inefficiency, PepperLa decides to add a new delivery station in the open space. According to "barrel principle" PepperLa hopes to reduce the maximum delivery time. It means to minimize the maximum delivery time of all users. Could You help him find the best place? Input There are multiple test cases in this problem. For every test case, The first line has 3 interger, $Z,X,Y(1 \leq Z,X,Y \leq 10^2)$ Then following $Z\times X$ lines each line contains $Y$ characters, the character in $i$'th row (start from 0), $j$'th column is $(z=\lfloor i/X \rfloor+1,x=i\%X+1, y=j)$ '.' represents open space, '*' represents a user, '@' represents a delivery station. The input guarantees that there is at least one '.' and at least one '@'. $\sum{Z\times X \times Y}\leq 6 \times 10^6$ Output For each test case, output a single line contains one integer,representing for the minimal delivery time. Sample Input
Sample Output
Hint the best place to set up a new delivery station is (z=2,x=2,y=2) Source | ||||||||||
|