B. Numbers on a Circle

Codeforces
IDCF10286B
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
You are given two integers $n$ and $k$. Determine whether there exists an array $a_0$, $a_1$, $\\dots$, $a_{n -1}$ with the properties: The input contains two integers $n$ and $k$, the length of the array and the value of the modulo ($2 <= n <= 10^9$, $1 <= k <= 10^9$). If there exists such an array, output "_Yes_", otherwise output "_No_". ## Input The input contains two integers $n$ and $k$, the length of the array and the value of the modulo ($2 <= n <= 10^9$, $1 <= k <= 10^9$). ## Output If there exists such an array, output "_Yes_", otherwise output "_No_". [samples]
**Definitions** Let $ n \in \mathbb{Z} $ be the number of wire slots in each set. Let $ A = a_1 a_2 \dots a_n $ be the string representing the first set of wire slots. Let $ B = b_1 b_2 \dots b_n $ be the string representing the second set of wire slots. **Constraints** 1. $ 1 \leq n \leq 52 $ 2. $ A $ and $ B $ are strings of $ n $ distinct alphabetic characters (uppercase or lowercase). 3. $ A $ and $ B $ contain the same multiset of characters. **Objective** For each $ i \in \{1, \dots, n\} $, find the one-based index $ j \in \{1, \dots, n\} $ such that $ a_i = b_j $. Output the sequence $ j_1 j_2 \dots j_n $, where $ j_i $ is the index of $ a_i $ in $ B $.
API Response (JSON)
{
  "problem": {
    "name": "B. Numbers on a Circle",
    "description": {
      "content": "You are given two integers $n$ and $k$. Determine whether there exists an array $a_0$, $a_1$, $\\\\dots$, $a_{n -1}$ with the properties:  The input contains two integers $n$ and $k$, the length of the",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10286B"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given two integers $n$ and $k$. Determine whether there exists an array $a_0$, $a_1$, $\\\\dots$, $a_{n -1}$ with the properties: \n\nThe input contains two integers $n$ and $k$, the length of the...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of wire slots in each set.  \nLet $ A = a_1 a_2 \\dots a_n $ be the string representing the first set of wire slots.  \nLet $ B = b_1 b_2 \\dots b_...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments