310933: CF1911B. Repeating Cipher
Description
Polycarp loves ciphers. He has invented his own cipher called repeating.
Repeating cipher is used for strings. To encrypt the string $s=s_{1}s_{2} \dots s_{m}$ ($1 \le m \le 10$), Polycarp uses the following algorithm:
- he writes down $s_1$ ones,
- he writes down $s_2$ twice,
- he writes down $s_3$ three times,
- ...
- he writes down $s_m$ $m$ times.
For example, if $s$="bab" the process is: "b" $\to$ "baa" $\to$ "baabbb". So the encrypted $s$="bab" is "baabbb".
Given string $t$ — the result of encryption of some string $s$. Your task is to decrypt it, i. e. find the string $s$.
InputThe first line contains integer $n$ ($1 \le n \le 55$) — the length of the encrypted string. The second line of the input contains $t$ — the result of encryption of some string $s$. It contains only lowercase Latin letters. The length of $t$ is exactly $n$.
It is guaranteed that the answer to the test exists.
OutputPrint such string $s$ that after encryption it equals $t$.
ExamplesInput6 baabbbOutput
babInput
10 ooopppssssOutput
oopsInput
1 zOutput
z
Output
- 写下s1一次,
- 写下s2两次,
- 写下s3三次,
- …
- 写下sm m次。
给定加密后的字符串t,要求解密,找到原始字符串s。
输入输出数据格式:
输入:
- 第一行包含一个整数n(1≤n≤55),表示加密字符串的长度。
- 第二行包含一个字符串t,表示加密后的字符串。t只包含小写拉丁字母,长度恰好为n。
输出:
- 输出解密后的字符串s。
示例:
输入:
```
6
baabbb
```
输出:
```
bab
```
输入:
```
10
ooopppssss
```
输出:
```
oops
```
输入:
```
1
z
```
输出:
```
z
```
注意:保证测试用例有解。题目大意:Polycarp发明了一种名为“重复”的加密算法,这种算法适用于字符串。对于一个长度为m的字符串s=s1s2…sm(1≤m≤10),加密过程如下: - 写下s1一次, - 写下s2两次, - 写下s3三次, - … - 写下sm m次。 给定加密后的字符串t,要求解密,找到原始字符串s。 输入输出数据格式: 输入: - 第一行包含一个整数n(1≤n≤55),表示加密字符串的长度。 - 第二行包含一个字符串t,表示加密后的字符串。t只包含小写拉丁字母,长度恰好为n。 输出: - 输出解密后的字符串s。 示例: 输入: ``` 6 baabbb ``` 输出: ``` bab ``` 输入: ``` 10 ooopppssss ``` 输出: ``` oops ``` 输入: ``` 1 z ``` 输出: ``` z ``` 注意:保证测试用例有解。