UVA10788 Parenthesizing Palindromes

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1729 [PDF](https://uva.onlinejudge.org/external/107/p10788.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10788/01ec15456dc5a89dc5581882f3d251bd647456d2.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10788/7bb4d58e4e319ad0cc2c34e4cfee8c862d916499.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10788/477cd24b96ff61dca3c4be3ddb5f31ae68ce679f.png)