{"problem":{"name":"192. Knight's Move","description":{"content":"You have an 8 by 8 chessboard with several knights on it. The chessboard has no other pieces on it. Given the positions of the knights, find all of the spaces that the knights can travel to in a singl","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269192"},"statements":[{"statement_type":"Markdown","content":"You have an 8 by 8 chessboard with several knights on it. The chessboard has no other pieces on it. Given the positions of the knights, find all of the spaces that the knights can travel to in a single move.\n\nRecall that in chess, a knight can move exactly 2 spaces in one direction, and exactly one space in a perpendicular direction. For example, a knight could move 2 spaces left and 1 space up, or 2 spaces up and 1 space left, but a knight could not move 2 spaces left on its own, or 1 space up and 1 space right, for example.\n\nThe input consists of 8 lines, each consisting of 8 characters, representing the chessboard.\n\nA single dot (\".\") represents an empty space on the chessboard, and an uppercase K (\"K\") represents the position of a knight.\n\nOutput 8 lines, in the same format as the input, except, replace each empty space that can be moved to by at least one knight in a single move with an asterisk (\"*\").\n\n## Input\n\nThe input consists of 8 lines, each consisting of 8 characters, representing the chessboard.A single dot (\".\") represents an empty space on the chessboard, and an uppercase K (\"K\") represents the position of a knight.\n\n## Output\n\nOutput 8 lines, in the same format as the input, except, replace each empty space that can be moved to by at least one knight in a single move with an asterisk (\"*\").\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ B \\in \\{ \\text{`.`}, \\text{`K`} \\}^{8 \\times 8} $ be the input chessboard, where $ B[i][j] = \\text{`K`} $ denotes a knight at row $ i $, column $ j $ (0-indexed).  \n\nLet $ N = \\{ (\\pm 2, \\pm 1), (\\pm 1, \\pm 2) \\} $ be the set of 8 possible knight move vectors.  \n\n**Constraints**  \n- $ i, j \\in \\{0, 1, \\dots, 7\\} $ for all board positions.  \n- Knights are only on squares where $ B[i][j] = \\text{`K`} $.  \n\n**Objective**  \nConstruct output board $ O \\in \\{ \\text{`.`}, \\text{`K`} , \\text{`*`} \\}^{8 \\times 8} $ such that:  \n- $ O[i][j] = \\text{`K`} $ if $ B[i][j] = \\text{`K`} $,  \n- $ O[i][j] = \\text{`*`} $ if $ B[i][j] = \\text{`.`} $ and $ \\exists (di, dj) \\in N $ such that $ (i - di, j - dj) \\in [0,7]^2 $ and $ B[i - di][j - dj] = \\text{`K`} $,  \n- $ O[i][j] = \\text{`.`} $ otherwise.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269192","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}