10533 번 : Ricochet Robots 
 10533 번 
 10533 번 - Ricochet Robots 
 1 초 256 MB 34 20 18 66 . 667 % 
 A team of up - to four robots is going to deliver parts in a factory floor . The floor is organized as a rectangular grid where each robot ocupies a single square cell . Each robot is represented by an integer from 1 to 4 and can move in the four orthogonal directions ( left , right , up , down ) . However , once set in motion , a robot will stop only when it detects a neighbouring obstacle ( i . e . walls , the edges of the factory or other stationary robots ) . Robots do not move simultaneously , i . e . only a single robot moves at each time step . 
 Consider the example given above , on the right , where the gray cells represent walls , X is the target location and 1 , 2 mark the initial positions of two robots . One optimal solution consists of the six moves described below . 
 The first line contains the number of robots n , the width w and height h of the factory floor in cells , and an upper - bound limit ℓ on the number of moves for searching solutions . 
 The remaining h lines of text represent rows of the factory floor with exactly w characteres each representing a cell position : 
 ’.’ an empty cell . 
 max ( w , h ) ≤ 10 
 w , h ≥ 1 
 1 ≤ ℓ ≤ 10 
 ACM - ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2014 E 번