{"problem":{"name":"chess960","description":{"content":"> Takahashi is playing a game called Chess960. He has decided to write a code that determines if a random initial state satisfies the conditions of Chess960. You are given a string $S$ of length eigh","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc297_b"},"statements":[{"statement_type":"Markdown","content":"> Takahashi is playing a game called Chess960. He has decided to write a code that determines if a random initial state satisfies the conditions of Chess960.\n\nYou are given a string $S$ of length eight. $S$ has exactly one `K` and `Q`, and exactly two `R`'s, `B`'s , and `N`'s. Determine if $S$ satisfies all of the following conditions.\n\n*   Suppose that the $x$\\-th and $y$\\-th $(x < y)$ characters from the left of $S$ are `B`; then, $x$ and $y$ have different parities.\n    \n*   `K` is between two `R`'s. More formally, suppose that the $x$\\-th and $y$\\-th $(x < y)$ characters from the left of $S$ are `R` and the $z$\\-th is `K`; then $x< z < y$.\n\n## Constraints\n\n*   $S$ is a string of length $8$ that contains exactly one `K` and `Q`, and exactly two `R`'s, `B`'s , and `N`'s.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc297_b","tags":[],"sample_group":[["RNBQKBNR","Yes\n\nThe $3$\\-rd and $6$\\-th characters are `B`, and $3$ and $6$ have different parities. Also, `K` is between the two `R`'s. Thus, the conditions are fulfilled."],["KRRBBNNQ","No\n\n`K` is not between the two `R`'s."],["BRKRBQNN","No"]],"created_at":"2026-03-03 11:01:14"}}