No.3036 Nauclhlt-Type String
Story
It is well known that nauclhlt is made from null and acht.
Problem Statement
For a pair of strings $(X, Y)$ satisfying $|X|=|Y|=L$, the corresponding Nauclhlt-type string is the string $Z$ of length $2L$ such that $Z_{2i-1}=X_i,\ Z_{2i}=Y_i$ for each $i(1\leq i\leq L)$.
For example, the Nauclhlt-type string corresponding to (bu, le) is blue.
You are given a string $S$ of length $N$. Determine whether there exists a pair of strings $(P, Q)$ of equal length whose corresponding Nauclhlt-type string equals $S$, and if it exists, find such a pair $(P, Q)$.
Notation for strings
For a string $A$, $|A|$ denotes the length of $A$, and $A_i(1\leq i\leq |A|)$ denotes the $i$-th character of $A$.Input
$N$ $S$
- $1\leq N\leq 10^5$
- $S$ is a string of length $N$ consisting of lowercase English letters
- $N$ is an integer
Output
If a pair $(P, Q)$ satisfying the conditions exists, print Yes on the first line, and on the second line print $P$ and $Q$ in this order, separated by a space. If it does not exist, print only No.
Print a newline at the end.
Sample
Sample 1
Input
8 nauclhlt
Output
Yes null acht
This is the natural result.
Sample 2
Input
5 apple
Output
No
No pair $(P, Q)$ satisfying the conditions exists. Therefore, print No.
Sample 3
Input
6 ababab
Output
Yes aaa bbb
Pay attention to the output format.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
nauclhlt
naniwazu