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

PepperLa's Express

Time 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
3 3 3 ... .*. ... @*@ *.* @*@ ... .*. ...
 

Sample Output
1
 

Hint

the best place to set up a new delivery station is (z=2,x=2,y=2)
 

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-05-11 18:52:59, Gzip enabled