#P6739. [BalticOI 2014] Three Friends (Day1)
[BalticOI 2014] Three Friends (Day1)
Description
There is a string , and we perform the following operations on it:
- Copy into two copies and store them in the string .
- Insert one character at some position in to obtain the string .
Now, given , find .
Input Format
The first line contains an integer , representing the length of .
The second line contains characters, representing the string .
Output Format
- If it is impossible to derive from using the steps above, output
NOT POSSIBLE. - If the obtained from is not unique, output
NOT UNIQUE. - Otherwise, output the string .
7
ABXCABC
ABC
6
ABCDEF
NOT POSSIBLE
9
ABABABABA
NOT UNIQUE
Hint
Constraints
This problem uses bundled testdata.
- Subtask 1 (35 pts): .
- Subtask 2 (65 pts): no special constraints.
For of the testdata, , and is guaranteed to contain only uppercase letters.
Notes
Translated from BalticOI 2014 Day1 B Three Friends。
Translated by ChatGPT 5
京公网安备 11011102002149号