Story -------- To solve the shortage of police officers, the Takahashi City Police Department has decided to introduce automated patrols with unmanned patrol cars. The unmanned patrol car is equipped with a high-resolution omnidirectional camera on the roof, which can see the entire road at once in a straight line from the current position. And then, it uses image processing technology to automatically detect suspicious activities. In order to provide a safe and secure life for the citizens, we want to set up a patrol route that allows the patrol car to see every corner of the city at least once. Among such patrol routes, please find as short a one as possible. Problem Statement -------- You are given a map consisting of $N\times N$ squares. Let $(0,0)$ denote the top-left square, and $(i,j)$ denote the square at the $i$-th row from the top and $j$-th column from the left. Each square is either an obstacle (`#`) or a road, and you can move up, down, left, or right on the road squares. Each road square contains a number `5`-`9`, which represents the amount of time you take to move from an adjacent square to that square. We define that a road square $(i',j')$ is visible from $(i,j)$ if and only if the following conditions are satisfied: - $i=i'$ and for every $j''$ with $\min(j,j')\leq j''\leq\max(j,j')$, $(i,j'')$ is a road square, or - $j=j'$ and for every $i''$ with $\min(i,i')\leq i''\leq\max(i,i')$, $(i'',j)$ is a road square. For example, in the figure below, the gray squares represent obstacles, the white and light yellow squares represent roads, and the road squares that are visible from the green circle are colored light yellow. ![](./images/1bc7c896310a65486d0ce3aa275f41b7.png "Example of visible squares") Your task is to find a route starting from a specified square $(si,sj)$, moving up, down, left, or right on road squares, and returning to $(si,sj)$, such that all the road squares become visible at least once. The shorter the route, the higher the score. You can move on the same square multiple times and even make a U-turn. Scoring -------- Let $r$ be the total number of road squares, $v$ be the number of road squares that become visible at least once, and $t$ be the total travel time of the output route. Then you will obtain the following score. - If $vInputs: A set of 100 inputs (seed 0-99) for local testing, including the sample input (seed 0). These inputs are different from the actual test cases. - Visualizer on the web - Input generator and visualizer: If you want to use more inputs, or if you want to visualize your output locally, you can use this program. You need a compilation environment of Rust language. {sample example}