Everyone knows the greedy snake game.Now this problem is the same as it.In a room,the rat is seeking food.Food will appear one by one after the rat gets one food.Food will only appear in the blanks.
You should output the minimum step number the rat should do when he gets all of food.