{"problem":{"name":"B. Colored Blankets","description":{"content":"Recently Polycarp has opened a blankets store and he faced with many challenges. He has got k blankets. A blanket has two sides, each of k blankets has at most one colored side. So either both sides ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10051B"},"statements":[{"statement_type":"Markdown","content":"Recently Polycarp has opened a blankets store and he faced with many challenges.\n\nHe has got k blankets. A blanket has two sides, each of k blankets has at most one colored side. So either both sides are uncolored or one side is colored and the other one is not. If a side is colored, one of n possible colors is used. It is known that k is divisible by n.\n\nPolycarp wants to color all uncolored sides in such a way that:\n\nIt is allowed to turn over blankets to determine that they are _identically colored_: for example, red-blue and blue-red blankets are _identically colored_. Blankets in different kits can be _identically colored_.\n\nThe first line contains two integer numbers k and n (1 ≤ n ≤ k ≤ 1000) — number of blankets and colors. It is guaranteed that k is divisible by n. The second line contains a sequence of integers c1, c2, ..., ck (1 ≤ ci ≤ n or ci =  - 1), where ci stands for the color of the colored side of the i-th blanket or  - 1 if it is uncolored.\n\nIf there is no solution for the problem, print \"_No_\" in the first line. Otherwise print a line containing \"_Yes_\" and k lines describing each blanket. The i-th line should contain a pair of colors (integers in the range 1, 2, ..., n) used for the i-th blanket. You may print colors in pairs in any order.\n\nIf there are multiple solutions, print any of them.\n\n## Input\n\nThe first line contains two integer numbers k and n (1 ≤ n ≤ k ≤ 1000) — number of blankets and colors. It is guaranteed that k is divisible by n. The second line contains a sequence of integers c1, c2, ..., ck (1 ≤ ci ≤ n or ci =  - 1), where ci stands for the color of the colored side of the i-th blanket or  - 1 if it is uncolored.\n\n## Output\n\nIf there is no solution for the problem, print \"_No_\" in the first line. Otherwise print a line containing \"_Yes_\" and k lines describing each blanket. The i-th line should contain a pair of colors (integers in the range 1, 2, ..., n) used for the i-th blanket. You may print colors in pairs in any order.If there are multiple solutions, print any of them.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ s \\in \\Sigma^* $ be the encrypted string, where $ \\Sigma = \\{a, b, \\dots, z\\} $ and $ 1 \\leq |s| \\leq 10^5 $.  \nLet $ p \\in \\mathbb{Z} $ be the decryption parameter, where $ 1 \\leq p \\leq |s| $.\n\n**Constraints**  \n1. $ s $ consists only of lowercase English letters.  \n2. $ 1 \\leq p \\leq |s| $\n\n**Objective**  \nDecrypt $ s $ by performing a cyclic left shift of the string by $ p $ positions:  \n$$\n\\text{original} = s[p:] + s[:p]\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10051B","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}