U332324 孪生数

题目背景

**本题采用 spj。** A few days ago I saw a video on the internet which shows a kind of spectacular numbers.**THEY COULD DESCRIBE THEMSELVES!** The video asked to find out a 10-digit-number.However,I tried to figure out the common solution of the n-digit-numbers.And then,I thought that there might be pairs of numbers,having similar features.And this is the idea of the problem.

题目描述

孪生数。 我们有一对数 $p$ 与 $q$ ,而且其位数均为 $n$。把它们按数位分解开来,记为数组 $a$ 与 $b$。 例如,$\texttt{1234567}$ 记为 $1,2,3,4,5,6,7$。 假设 $a$ 中等于 $0$ 的个数恰好有 $A_1$ 个,等于 $1$ 的有 $A_2$ 个,... ... ,等于 $n-1$ 的有 $A_n$ 个。 同理,假设 $b$ 中等于 $0$ 的个数恰好有 $B_1$ 个,等于 $1$ 的有 $B_2$ 个,... ... ,等于 $n-1$ 的有 $B_n$ 个。 由此得到数组 $A$ 与 $B$。**(注意数位上等于 $0$ 的个数对应下标 $1$!)** 形式化地,$A_i=\sum [a_j=i-1],B_i=\sum [b_j=i-1]$。 如果 $a$ 恰好与 $B$ 相等,而且 $b$ 恰好与 $A$ 相等,则称原数 $p$ 与 $q$ 是一对孪生数。 举例说明,$\texttt{230100}$ 与 $\texttt{311100}$ 就是一对孪生数。 现在,我们希望你构造一对位数为 $n$ 的孪生数。如果 $n$ 大于 $10$,显然这两个数可能**不是**十进制的。因而默认为**无穷进制**。在输出格式中将有注明,使得你能够直接按**每个数位**十进制地输出。 但是,因为你能够构造一对相同的数,如 $(\texttt{1210},\texttt{1210})$,降低了题目难度,所以题目要求构造两对数:第一对数两数相同,第二对两数不同。如果有解先输出 Yes,再依次输出两个数;如果不能得出解,输出 No 。

输入格式

一行一个正整数 $n$。

输出格式

分六行。 第一行输出 ```Yes``` 或 ```No```,代表第一对数是否有解。 第二行输出你构造的第一对数中的第一个数,每个数位之间有空格。注意,$\texttt{100 0 1 0 0}$ 等数(即某个数位在 $10$ 及以上的)就这样输出。若无解,不输出也不必换行。 第三行输出你构造的第一对数中的第二个数。若无解,不输出也不必换行。 第四行输出 ```Yes``` 或 ```No```,代表第二对数是否有解。 第五行输出你构造的第二对数中的第一个数。若无解,不输出也不必换行。 第六行输出你构造的第二对数中的第二个数。若无解,不输出也不必换行。

说明/提示

对于 10% 的数据,有 $1 \leq n \leq 10$。 对所有数据,$1\leq n \leq 5\times 10^6$。请选择较快速的输出方式。 And by the way,according to Legendary Grandmaster zyh_helen,the difficulty of this problem(using codeforces rating)is possibly in [2300,2500]. Actually a ring consisting of numbers which describe each other doesn't have a common solution when 3 $\leq$ n (the lenth of the ring).