AtCoder Beginner Contest 066
B
ss
AtCoder
⌀ 384
原题
← AC →
翻译中…

Problem Statement

翻译中…

We will call a string that can be obtained by concatenating two equal strings an even string. For example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not.

翻译中…

You are given an even string $S$ consisting of lowercase English letters. Find the length of the longest even string that can be obtained by deleting one or more characters from the end of $S$. It is guaranteed that such a non-empty string exists for a given input.

翻译中…

Constraints

翻译中…
  • $2 \leq |S| \leq 200$
  • $S$ is an even string consisting of lowercase English letters.
  • There exists a non-empty even string that can be obtained by deleting one or more characters from the end of $S$.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

S

翻译中…

Output

翻译中…

Print the length of the longest even string that can be obtained.

翻译中…

样例

Input #1
abaababaab
Output #1
6
- `abaababaab` itself is even, but we need to delete at least one character. - `abaababaa` is not even. - `abaababa` is not even. - `abaabab` is not even. - `abaaba` is even. Thus, we should print its length, $6$.
Input #2
xxxx
Output #2
2
- `xxx` is not even. - `xx` is even.
Input #3
abcabcabcabc
Output #3
6
The longest even string that can be obtained is `abcabc`, whose length is $6$.
Input #4
akasakaakasakasakaakas
Output #4
14
The longest even string that can be obtained is `akasakaakasaka`, whose length is $14$.
题目信息
题号
abc066_b
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。