最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 1758A - SSeeeeiinngg DDoouubbllee

2023-08-11 13:45 作者:您是打尖兒還是住店呢  | 我要投稿

A palindrome is a string that reads the same backward as forward. For example, the strings z, aaa, aba, and abccba are palindromes, but codeforces and ab are not.

The double of a string s is obtained by writing each character twice. For example, the double of seeing is sseeeeiinngg.

Given a string s, rearrange its double to form a palindrome. Output the rearranged string. It can be proven that such a rearrangement always exists.


Input The first line of input contains t (1≤t≤1000) — the number of test cases.

The only line of each test case contains a single string s (1≤|s|≤100) consisting only of lowercase English letters.


Note that the sum of |s| over all test cases is not bounded.


Output

For each test case, output a palindromic string of length 2?|s| that is a rearrangement of the double of s.

----------------------------------------

回文是向后讀與向前讀相同的字符串。 例如,字符串 z、aaa、aba 和 abccba 是回文,但 codeforces 和 ab 不是回文。

字符串 s 的 double 是通過將每個字符寫入兩次而獲得的。 例如,“看見”的雙重含義是“sseeeeiinngg”。

給定一個字符串 s,重新排列它的雙精度數(shù)以形成回文。 輸出重新排列的字符串。 可以證明這樣的重排總是存在的。


輸入 第一行輸入包含 t (1≤t≤1000) — 測試用例的數(shù)量。

每個測試用例的唯一行包含一個僅由小寫英文字母組成的字符串 s (1≤|s|≤100)。


請注意 |s| 的總和 所有測試用例都不受限制。


輸出

對于每個測試用例,輸出長度為 2?|s| 的回文字符串 這是雙 s 的重新排列。

------------------------------------------------------------

回文構造;

代碼如下:


CF 1758A - SSeeeeiinngg DDoouubbllee的評論 (共 條)

分享到微博請遵守國家法律
石嘴山市| 孟州市| 全南县| 巴青县| 牙克石市| 全南县| 营口市| 洞口县| 平塘县| 和静县| 黔南| 长阳| 玉屏| 土默特左旗| 沾化县| 通城县| 江陵县| 固始县| 濮阳市| 拉孜县| 驻马店市| 祁门县| 双鸭山市| 阳原县| 伊吾县| 桃园县| 西城区| 天水市| 六枝特区| 淳化县| 长宁县| 博兴县| 莱芜市| 沁水县| 波密县| 岳阳市| 横峰县| 黑河市| 曲水县| 含山县| 油尖旺区|