{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot move diagonally and the maze is surrounded by solid rock on all sides. \n\u003cbr\u003e\n\u003cbr\u003eIs an escape possible? If yes, how long will it take? \n\u003cbr\u003e\n\u003chr/\u003e\n\u003cp\u003e你被困在一个 $L\\times R\\times C$ 的三维迷宫内,每分钟你只能够往上、下、左、右、前、后这六个方向的任意一个方向走一个单位。初始时你位于 $S$ 位置,迷宫的出口为 $E$ 位置,迷宫中标 $\\#$ 的位置无法通过,并且你也不能够走出迷宫的边界。\u003c/p\u003e\n\u003cp\u003e你是否能够走出这个迷宫?如果能,求出最少的时间。\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input consists of a number of dungeons. Each dungeon description starts with a line containing three integers L, R and C (all limited to 30 in size). \n\u003cbr\u003eL is the number of levels making up the dungeon. \n\u003cbr\u003eR and C are the number of rows and columns making up the plan of each level. \n\u003cbr\u003eThen there will follow L blocks of R lines each containing C characters. Each character describes one cell of the dungeon. A cell full of rock is indicated by a \u0027#\u0027 and empty cells are represented by a \u0027.\u0027. Your starting position is indicated by \u0027S\u0027 and the exit by the letter \u0027E\u0027. There\u0027s a single blank line after each level. Input is terminated by three zeroes for L, R and C. \n\u003chr/\u003e\n\u003cp\u003e迷宫有 $L$ 层,每层长宽为 $R\\times C$。$(L,R,C\\le 30)$\u003c/p\u003e\n\u003cp\u003e输入有多组,以 $L\u003dR\u003dC\u003d0$ 结束。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Each maze generates one line of output. If it is possible to reach the exit, print a line of the form \n\u003ccode\u003eEscaped in x minute(s).\u003c/code\u003e\nwhere x is replaced by the shortest time it takes to escape. \n\u003cbr\u003e\nIf it is not possible to escape, print the line \u003ccode\u003eTrapped! \u003c/code\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 4 5\nS....\n.###.\n.##..\n###.#\n\n#####\n#####\n##.##\n##...\n\n#####\n#####\n#.###\n####E\n\n1 3 3\nS##\n#E#\n###\n\n0 0 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eEscaped in 11 minute(s).\nTrapped!\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}