{"problem":{"name":"B. Binary String Constructing","description":{"content":"You are given three integers $a$, $b$ and $x$. Your task is to construct a binary string $s$ of length $n = a + b$ such that there are exactly $a$ zeroes, exactly $b$ ones and exactly $x$ indices $i$ ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF1003B"},"statements":[{"statement_type":"Markdown","content":"You are given three integers $a$, $b$ and $x$. Your task is to construct a binary string $s$ of length $n = a + b$ such that there are exactly $a$ zeroes, exactly $b$ ones and exactly $x$ indices $i$ (where $1 \\le i &lt; n$) such that $s_i \\ne s_{i + 1}$. It is guaranteed that the answer always exists.\n\nFor example, for the string \"_01010_\" there are four indices $i$ such that $1 \\le i &lt; n$ and $s_i \\ne s_{i + 1}$ ($i = 1, 2, 3, 4$). For the string \"_111001_\" there are two such indices $i$ ($i = 3, 5$).\n\nRecall that binary string is a non-empty sequence of characters where each character is either _0_ or _1_.\n\n## Input\n\nThe first line of the input contains three integers $a$, $b$ and $x$ ($1 \\le a, b \\le 100, 1 \\le x &lt; a + b)$.\n\n## Output\n\nPrint only one string $s$, where $s$ is **any** binary string satisfying conditions described above. It is guaranteed that the answer always exists.\n\n[samples]\n\n## Note\n\nAll possible answers for the first example:\n\n*   _1100_;\n*   _0011_.\n\nAll possible answers for the second example:\n\n*   _110100_;\n*   _101100_;\n*   _110010_;\n*   _100110_;\n*   _011001_;\n*   _001101_;\n*   _010011_;\n*   _001011_.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"给你三个整数 $a$、$b$ 和 $x$。你的任务是构造一个长度为 $n = a + b$ 的二进制字符串 $s$，使得其中恰好有 $a$ 个零、恰好 $b$ 个一，并且恰好有 $x$ 个索引 $i$（其中 $1 lt.eq i < n$）满足 $s_i != s_{i + 1}$。题目保证答案一定存在。\n\n例如，对于字符串 \"_01010_\"，有四个索引 $i$ 满足 $1 lt.eq i < n$ 且 $s_i != s_{i + 1}$（$i = 1, 2, 3, 4$）。对于字符串 \"_111001_\"，有两个这样的索引 $i$（$i = 3, 5$）。\n\n回忆一下，二进制字符串是非空的字符序列，其中每个字符要么是 _0_，要么是 _1_。\n\n输入的第一行包含三个整数 $a$、$b$ 和 $x$（$1 lt.eq a, b lt.eq 100$，$1 lt.eq x < a + b$）。\n\n请仅输出一个字符串 $s$，其中 $s$ 是满足上述条件的任意一个二进制字符串。题目保证答案一定存在。\n\n第一个示例的所有可能答案：\n\n第二个示例的所有可能答案：\n\n## Input\n\n输入的第一行包含三个整数 $a$、$b$ 和 $x$（$1 lt.eq a, b lt.eq 100$，$1 lt.eq x < a + b$）。\n\n## Output\n\n请仅输出一个字符串 $s$，其中 $s$ 是满足上述条件的任意一个二进制字符串。题目保证答案一定存在。\n\n[samples]\n\n## Note\n\n第一个示例的所有可能答案： _1100_；_0011_。第二个示例的所有可能答案： _110100_；_101100_；_110010_；_100110_；_011001_；_001101_；_010011_；_001011_。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ a, b, x \\in \\mathbb{Z}^+ $ such that $ 1 \\leq a, b \\leq 100 $ and $ 1 \\leq x < a + b $.  \nLet $ n = a + b $.  \nLet $ s = s_1 s_2 \\dots s_n $ be a binary string of length $ n $, where each $ s_i \\in \\{0, 1\\} $.\n\n**Constraints**  \n1. The string $ s $ contains exactly $ a $ zeros and $ b $ ones.  \n2. The number of indices $ i \\in \\{1, 2, \\dots, n-1\\} $ such that $ s_i \\neq s_{i+1} $ is exactly $ x $.  \n\n**Objective**  \nConstruct any binary string $ s $ satisfying the above constraints.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF1003B","tags":["constructive algorithms"],"sample_group":[["2 2 1","1100"],["3 3 3","101100"],["5 3 6","01010100"]],"created_at":"2026-03-03 11:00:39"}}