Codeforces Round 704 (Div. 2)
D
Genius's Gambit
Codeforces
1900
原题
← CE →
翻译中…

You are given three integers $a$, $b$, $k$.

翻译中…

Find two binary integers $x$ and $y$ ($x \ge y$) such that

翻译中…
  1. both $x$ and $y$ consist of $a$ zeroes and $b$ ones;
  2. $x - y$ (also written in binary form) has exactly $k$ ones.
翻译中…

You are

翻译中…

not allowed to use leading zeros for $x$ and $y$

翻译中…

.

翻译中…

Input

翻译中…

The only line contains three integers $a$, $b$, and $k$ ($0 \leq a$; $1 \leq b$; $0 \leq k \leq a + b \leq 2 \cdot 10^5$) — the number of zeroes, ones, and the number of ones in the result.

翻译中…

Output

翻译中…

If it's possible to find two suitable integers, print "Yes" followed by $x$ and $y$ in base-2.

翻译中…

Otherwise print "No".

翻译中…

If there are multiple possible answers, print any of them.

翻译中…

Note

翻译中…

In the first example, $x = 101000_2 = 2^5 + 2^3 = 40_{10}$, $y = 100001_2 = 2^5 + 2^0 = 33_{10}$, $40_{10} - 33_{10} = 7_{10} = 2^2 + 2^1 + 2^0 = 111_{2}$. Hence $x-y$ has $3$ ones in base-2.

翻译中…

In the second example, $x = 10100_2 = 2^4 + 2^2 = 20_{10}$, $y = 10010_2 = 2^4 + 2^1 = 18$, $x - y = 20 - 18 = 2_{10} = 10_{2}$. This is precisely one 1.

翻译中…

In the third example, one may show, that it's impossible to find an answer.

翻译中…

样例

Input #1
4 2 3
Output #1
Yes
101000
100001
InputCopy OutputCopy
Input #2
3 2 1
Output #2
Yes
10100
10010
InputCopy OutputCopy
Input #3
3 2 5
Output #3
No
InputCopy OutputCopy
题目信息
题号
1492D
时间限制
2 s
内存限制
512 MB
标签
位运算
构造
贪心
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。