{"raw_statement":[{"iden":"statement","content":"The Hall Of Mirrors\n\nYou are in a hall of mirrors, and you shine a laser beam in a certain direction. Given the position of several diagonal mirrors, figure out the path of the laser beam.\n\nYou shine your laser beam from the back of the hall of mirrors (on a computer screen, this will look like the \"bottom\" of the image).\n\nThe first line of input contains two space-separated integers $n$, $m$, and $x$. $n$ and $m$ represent the number of rows and columns, respectively, and the number $x$ represents the index on the bottom row that you start shining the laser pointer at (with 0-based indices). The next $n$ lines contain $m$ characters representing the hall of mirrors. If a position does not contain a mirror, it will be pictured as a single dot. If it does have a mirror, it will be represented with either a forward slash (\"/\") or a backslash, which represents the direction that it reflects light in. See the example cases if you are confused on this.\n\nOutput the given input matrix, however, replace any positions without a mirror that the laser pointer shines through horizontally with a hyphen, and replace any positions without a mirror that the laser pointer shines through vertically with a pipe (\"|\"), above the ENTER key on a keyboard. If the laser pointer travels through a space in both directions, replace the dot in that position with a plus symbol (\"+\").\n\n"},{"iden":"input","content":"The first line of input contains two space-separated integers $n$, $m$, and $x$. $n$ and $m$ represent the number of rows and columns, respectively, and the number $x$ represents the index on the bottom row that you start shining the laser pointer at (with 0-based indices). The next $n$ lines contain $m$ characters representing the hall of mirrors. If a position does not contain a mirror, it will be pictured as a single dot. If it does have a mirror, it will be represented with either a forward slash (\"/\") or a backslash, which represents the direction that it reflects light in. See the example cases if you are confused on this."},{"iden":"output","content":"Output the given input matrix, however, replace any positions without a mirror that the laser pointer shines through horizontally with a hyphen, and replace any positions without a mirror that the laser pointer shines through vertically with a pipe (\"|\"), above the ENTER key on a keyboard. If the laser pointer travels through a space in both directions, replace the dot in that position with a plus symbol (\"+\")."},{"iden":"examples","content":"Input10 10 5\n..........\n..........\n/....\\....\n..........\n..........\n..........\n..........\n\\.........\n..........\n..........\nOutput..........\n..........\n/----\\....\n|....|....\n|....|....\n|....|....\n|....|....\n\\----+----\n.....|....\n.....|....\nInput10 10 3\n/.\\.......\n./....\\...\n..........\n..........\n.\\.\\......\n..........\n..\\.../...\n..........\n..........\n\\.........\nOutput/-\\.......\n|/+---\\...\n|||...|...\n|||...|...\n|\\+\\..|...\n|.||..|...\n|.\\+--/...\n|..|......\n|..|......\n\\--+------\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m, x \\in \\mathbb{Z} $, where $ n $ is the number of rows, $ m $ is the number of columns, and $ x \\in \\{0, \\dots, m-1\\} $ is the 0-based starting column index on the bottom row.  \nLet $ G \\in \\{ \\text{`.`}, \\text{`/`}, \\text{`\\`'} \\}^{n \\times m} $ be the grid representing the hall of mirrors.  \n\n**Constraints**  \n1. $ 1 \\leq n, m \\leq 100 $  \n2. $ 0 \\leq x < m $  \n\n**Objective**  \nSimulate the path of a laser beam starting at position $ (n-1, x) $, traveling upward (positive $ y $-direction), and reflecting upon encountering mirrors:  \n- A `/` mirror reverses direction: $ (\\Delta x, \\Delta y) \\mapsto (-\\Delta y, -\\Delta x) $  \n- A `\\` mirror reverses direction: $ (\\Delta x, \\Delta y) \\mapsto (\\Delta y, \\Delta x) $  \n\nTrack the beam’s trajectory through empty cells (`.`), and annotate them as:  \n- `\\-` if traversed horizontally ($ \\Delta x = \\pm 1, \\Delta y = 0 $)  \n- `|` if traversed vertically ($ \\Delta x = 0, \\Delta y = \\pm 1 $)  \n- `+` if traversed in both directions  \n\nOutput the modified grid with annotations, leaving mirrors (`/`, `\\`) unchanged.","simple_statement":"You are in a room with mirrors. Shine a laser from the bottom at position x. Track its path. Mirrors are \"/\" or \"\\\". Replace empty spaces the laser passes through: use \"-\" for horizontal, \"|\" for vertical, \"+\" if both. Print the grid with these symbols.","has_page_source":false}