#P14603. [NWRRC 2025] Defense Distance

[NWRRC 2025] Defense Distance

题目描述

The NWRRC security server has a final access check for teams that try to submit their solutions to the secret hidden problem.

To pass the check, the team must enter three passwords ss, tt, and uu that the system will accept. Each password must be a non-empty string consisting of at most 50005000 lowercase English letters.

The rules of the server are public:

  • The distance between ss and tt should be equal to aa.
  • The distance between ss and uu should be equal to bb.
  • The distance between tt and uu should be equal to cc.

The distance\textit{distance} between two strings s1s_1 and s2s_2 is the minimum number of single-character operations (insert one character, remove one character, or replace one character) needed to convert string s1s_1 into string s2s_2. This metric is also known as the Levenshtein distance.

The server gives access to the hidden problem if and only if all described conditions are satisfied. Your goal is to construct a triple of passwords to unlock the hidden problem or determine that it is impossible.

输入格式

The only line contains three integers aa, bb, and cc, denoting the required distances between each pair of passwords (0a,b,c10000 \le a, b, c \le 1000).

输出格式

If there are no three passwords with the required properties, print No\texttt{No} in the only line.

Otherwise, print Yes\texttt{Yes} in the first line. Then print passwords ss, tt, and uu in the following three lines. Each password should consist of at least 11 and at most 50005000 lowercase English letters.

If there are multiple triples of passwords that meet the requirements, print any of them.

4 3 5
Yes
icpc
nwrrc
itmo
2 2 2
Yes
aa
bb
cc
0 0 1 
No

提示

In the first test case:

  • The distance between icpc\texttt{icpc} and nwrrc\texttt{nwrrc} is 44: icpc\texttt{icpc} \to irpc\texttt{irpc} \to irrc\texttt{irrc} \to nrrc\texttt{nrrc} \to nwrrc\texttt{nwrrc}.
  • The distance between icpc\texttt{icpc} and itmo\texttt{itmo} is 33: icpc\texttt{icpc} \to itpc\texttt{itpc} \to itpo\texttt{itpo} \to itmo\texttt{itmo}.
  • The distance between nwrrc\texttt{nwrrc} and itmo\texttt{itmo} is 55: nwrrc\texttt{nwrrc} \to wrrc\texttt{wrrc} \to wrro\texttt{wrro} \to irro\texttt{irro} \to itro\texttt{itro} \to itmo\texttt{itmo}.

In the second test case, the distance between each pair of passwords is 22.

In the third test case, it can be shown that there are no three passwords with the required properties.