{"trustable":true,"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. \r\u003cbr\u003e\r\u003cbr\u003eIs an escape possible? If yes, how long will it take? \r\u003cbr\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). \r\u003cbr\u003eL is the number of levels making up the dungeon. \r\u003cbr\u003eR and C are the number of rows and columns making up the plan of each level. \r\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. "}},{"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 \r\u003cbr\u003e\u003cblockquote\u003eEscaped in x minute(s). \u003c/blockquote\u003e\r\u003cbr\u003ewhere x is replaced by the shortest time it takes to escape. \r\u003cbr\u003eIf it is not possible to escape, print the line \r\u003cbr\u003e\u003cblockquote\u003eTrapped! \u003c/blockquote\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\r\nS....\r\n.###.\r\n.##..\r\n###.#\r\n\r\n#####\r\n#####\r\n##.##\r\n##...\r\n\r\n#####\r\n#####\r\n#.###\r\n####E\r\n\r\n1 3 3\r\nS##\r\n#E#\r\n###\r\n\r\n0 0 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eEscaped in 11 minute(s).\r\nTrapped!\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}