Problem:


Score : 200 points

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.

Sample Input 1

abaababaab

Sample 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.

Sample Input 2

xxxx

Sample Output 2

2

xxx is not even.

xx is even.

Sample Input 3

abcabcabcabc

Sample Output 3

6

The longest even string that can be obtained is abcabc, whose length is 6.

Sample Input 4

akasakaakasakasakaakas

Sample Output 4

14

The longest even string that can be obtained is akasakaakasaka, whose length is 14.



Sample input:
abaababaab


Sample output:
6

Submission status: Accepted

Solution code:
s = list(input())


def check(L):
    if len(L)%2 != 0:
        return False
    
    n = int(len(L)/2)
    if L[:n] == L[n:]:
        #print(L[:n],L[n:])
        return True



#print(check(s))

for i in range(1,len(s)):
    m = len(s) - i
    if check(s[0:m]):
        print(m)
        exit()

Submission status: Accepted

Solution code:
s=input()
for i in range(1,len(s)):
    s1=s[0:len(s)-i]
    if len(s1)%2!=0:
        continue

    s2=s1[0:len(s1)//2]
    s3=s1[len(s1)//2:len(s1)]
    if s2==s3:
        print(len(s1))
        exit()

Submission status: Accepted

Solution code:
s = input()

l = len(s)
ans = 0
for i in range(1,l):
    if len(s[:l-i]) % 2 == 0:
        if s[:(l-i)//2] * 2 == s[:(l-i)]:
            ans = (l-i)
            break
print(ans)

Submission status: Accepted

Solution code:
s = input()
i = 0
while True:
    s = s[:-2]
    if s[0:(len(s)//2)] == s[(len(s)//2):len(s)]:
        print (len(s))
        exit ()

Submission status: Accepted

Solution code:
S=input()
N=len(S)

ans=0
for i in range(2,N,2):
    T=S[:-i]
    M=len(T)//2
    if T[:M]==T[M:]:
        ans=max(ans,len(T))

print(ans)

Submission status: Accepted

Solution code:
#abc067 b
s=input()

def func(mid):
    flag=True
    for i in range(mid):
        if s[i]!=s[mid+i]:
            flag=False
    return flag

for i in range(len(s)-1,1,-1):
    if i%2==1:
        continue
    else:
        mid=i//2
        if func(mid):
            print(i)
            break

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
s = input()

slis = list(s)
slis = slis[:-1]

ans = len(s)

while len(slis) > 0:
    if len(slis)%2 == 1:
        slis = slis[:-1]
        continue
    else:
        slicenum = len(slis)//2
        if slis[:slicenum] == slis[slicenum:]:
            ans = len(slis)
            break
        else:
            slis =slis[:-1]
            continue
    
print(ans)
# print("{:.10f}".format(ans))

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
count=0
for i in range(n):
  if (n-count)%2==0:
    if s[:(n-count)//2]==s[(n-count)//2:] and count>0:
      print(n-count)
      exit()
  count+=1
  s.pop()

Submission status: Accepted

Solution code:
string = input()

for i in range(len(string)):
    s = string[:-(i+1)]

    if len(s)%2 == 1:
        continue
    else:
        half = int(len(s)/2)
        s1 = s[:half]
        s2 = s[half:]

        if s1 == s2:
            print(half*2)
            break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: str):
    for i in reversed(range(1, len(S) // 2)):
        if S[:i] == S[i:2 * i]:
            print(2 * i)
            return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
# input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    S = input()
    answer = len(S)-1

    def is_even(s):
        if len(s)&1:
            return False
        
        half_length = len(s)//2
        if s[:half_length] == s[half_length:]:
            return True
        else:
            return False
    
    while True:
        S = S[:-1]
        if is_even(S):
            print(len(S))
            return
        
        answer -= 1
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    S=list(input())
    while True:
        S.pop(-1)
        l=len(S)
        if S[:l//2]==S[l//2:]:
            print(l)
            break



resolve()

Submission status: Accepted

Solution code:
s = input()
n = len(s)
s = s[:-2]
for _ in range(n):
  n = len(s)
  m = int(n/2)
  if s[:m] == s[m:]:
    print(len(s))
    break
  else:
    s = s[:-2]

Submission status: Accepted

Solution code:
S=input()
for i in range (len(S)):
	if S[:i]==S[i:i*2]:
		if i*2<len(S):
			ans=i*2
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
while len(s) > 1:
    s.pop(-1)
    
    if len(s)%2 == 0:
        s1 = s[0:len(s)//2]
        s2 = s[len(s)//2:]
        # print(s1)
        # print(s2)
        if s1 == s2:
            print(len(s))
            exit()

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(2,n-1,2):
    if s[:(n-i)//2] == s[(n-i)//2:n-i]:
        print(n-i)
        exit()

Submission status: Accepted

Solution code:
S=['a','x','z','c']
S=input()
words=[a for a in S]
n=len(words)
if n%2==1:
    del words[-1]
else:
    del words[-2:]
while True:
    n=len(words)
    m=round(n/2)
    if words[:m]==words[-m:]:
        print(n)
        break
    else:
        del words[-2:]

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(200000000)


# my functions here!

#入力

def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    N=input()
    n=len(N)//2
    ans=0
    
    for i in range(n):
        if N[0:i]*2==N[0:i*2]:
            ans=max(ans,i*2)
    print(ans)
        
     
"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """abaababaab"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """xxxx"""
        output = """2"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """abcabcabcabc"""
        output = """6"""
        self.assertIO(input, output)
    def test_入力例_4(self):
        input = """akasakaakasakasakaakas"""
        output = """14"""
        self.assertIO(input, output)
if __name__=="__main__":resolve()

Submission status: Accepted

Solution code:
import sys
s=input().strip()
for i in range(1,1000):
  r=-2*i
  s2 = s[:r]
  half=len(s2)//2
  if s2[half:]==s2[:half*-1]:
    print(len(s)+r)
    sys.exit()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

s = list(input())
while len(s) != 0:
    s.pop()
    if len(s) % 2 == 0 and s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        exit()

Submission status: Accepted

Solution code:
l=list(input())
for i in range(len(l)):
            del l[-1]
            if len(l)%2!=0:
                        del l[-1]
                        #print('1',l)
            if len(l)%2==0:
                        if l[:len(l)//2]==l[len(l)//2:]:
                                    print(len(l))
                                    exit()
                        else:
                                    del l[-1]
                                    #print('3',l)

Submission status: Accepted

Solution code:
S = input()
for i in range(len(S)):
  a = S[:len(S)//2]
  b = S[len(S)//2:]
  if a == b:
    if i != 0:
      print(len(a)*2)
      exit()
  S = S[:len(S)-1]

Submission status: Accepted

Solution code:
S = input()
N = len(S)
for i in range(2,N+1,2):
  if S[:(N-i)//2]==S[(N-i)//2:-i]:
    print(N-i)
    break

Submission status: Accepted

Solution code:
s = input()
for i in range(len(s)-1):
    s = s[:-1]
    t = len(s)//2
    if s[:t] == s[t:]:
        print(len(s))
        exit()

Submission status: Accepted

Solution code:
s=input()
n=len(s)//2*2
for i in range(n-2,1,-2):
    if s[:i//2]==s[i//2:i]:
        print(i)
        exit()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    
    def ch(s):
        n=len(s)
        s1=s[:n//2]
        s2=s[n//2:]
        if s1==s2:
            return True
        else:
            return False
        
    S=input()    
    N=len(S)-1
    ans=0
    for i in range(1,N):
        S2=S[:N-2*i]
        if ch(S2):
            ans=N-2*i
            break
    print(ans)

main()

Submission status: Accepted

Solution code:
S=input()
for i in range(len(S)-2,-1,-2):
    good=True
    for j in range(i//2):
        if S[j]!=S[i//2+j]:
            good=False
    if good:
        print(i)
        break

Submission status: Accepted

Solution code:
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    s = input()
    n = len(s)
    if n%2==0:
        for _ in range(200):
            s = s[:n-2]
            n = len(s)
            if s[:n//2]==s[n//2:]:
                print(n)
                exit()
    else:
        s = s[:n-1]
        for _ in range(200):
            s = s[:n-1]
            n = len(s)
            if s[:n//2]==s[n//2:]:
                print(n)
                exit()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
for i in reversed(range(1,len(S))):
    s=S[:i]
    if(len(s)%2!=0):
        continue
    if(s[:len(s)//2]==s[len(s)//2:]):
        print(len(s))
        exit()

Submission status: Accepted

Solution code:
S=str(input())
S=S[:len(S)-1]
if len(S)%2==1:
    S=S[:len(S)-1]
while S[:len(S)//2]*2!=S:
    S=S[:len(S)-2]
print(len(S))

Submission status: Accepted

Solution code:
s = input()
a = len(s)
for i in range(1,a):
	t = s[:a-i]
	if len(t)%2 == 1:
		continue
	if t[:len(t)//2] == t[len(t)//2:]:
		print (len(t))
		exit()

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(n):
  s = s[:-1]
  l = len(s)
  if len(s) % 2 == 0 and s[:l//2] == s[l//2:]:
    print(len(s))
    exit()

Submission status: Accepted

Solution code:
s = input()
s =  s[:len(s)-1]

if len(s)%2 == 1:
    s =  s[:len(s)-1]
    
while s[:len(s)//2]*2 !=  s:
    s =  s[:len(s)-2]
    
print(len(s))

Submission status: Accepted

Solution code:
strs = input()

ans = 0
length = 0
single = ''

for idx, s in enumerate(strs[:(len(strs)-1)//2]):
    single += s
    length += 1
    comp = strs[idx+1:idx+length+1]
    if single == comp:
        ans = length * 2

print(ans)

Submission status: Accepted

Solution code:
#ABC066

s = input()
m = 2
for i in range(1,len(s)//2):
    #print(s[:i],s[i:2*i])
    if s[:i] == s[i:2*i]:
        m = 2 * i
        
print(m)

Submission status: Accepted

Solution code:
s = input()
while (True):
    s = s[:len(s) - 2]
    ls = len(s)
    if s[ls // 2:] == s[:ls // 2]:
        break
print(len(s))

Submission status: Accepted

Solution code:
s = input()
l = len(s)
ans = 0
search = l-1

if search < 2:
    print(0)
    exit()

while search >= 2:
    if search % 2 == 0:
        if s[0:search//2] == s[search//2:search]:
            ans = max(ans, search)
    else:
        pass
    search -= 1
print(ans)

Submission status: Accepted

Solution code:
#066_B
s=input()
for i in range(len(s)//2-1,0,-1):
    t=s[:i]
    r=s[:2*i]
    if t*2==r:
        print(len(r))
        break

Submission status: Accepted

Solution code:
a = list(input())
b = len(a)
while True:
  del a[-1]
  b -= 1
  if b % 2 == 0 and a[:b//2] == a[b//2:]:
    print(b)
    break

Submission status: Accepted

Solution code:
S = input()

for i in range(1,len(S)) :
    if (len(S)-i)%2 == 1 :
        continue
    else :
        halflen = (len(S)-i) // 2
        preS = S[:-i-halflen]
        postS = S[halflen:-i]
        if preS == postS :
            print(len(S)-i)
            exit()

Submission status: Accepted

Solution code:
S=list(input())
S_re=list(reversed(S))
N=len(S)

if N%2==0:
    start=2
else:
    start=1

ans=0
for i in range(start,N,1):
    S_=S[i:]
    S_re_=S_re[i:]
    l_S=len(S_)
    if S_[l_S//2:]==S_[:l_S//2] and ans<l_S:
        ans=l_S
    if S_re_[l_S//2:]==S_re_[:l_S//2] and ans<l_S:
        ans=l_S

print(ans)

Submission status: Accepted

Solution code:
s=input()[:-1]
while s[:len(s)//2]!=s[len(s)//2:]:
    s=s[:-1]
print(len(s))

Submission status: Accepted

Solution code:
s = input()
for i in range(2, len(s)):
    if s[:-i] == s[:(len(s)-i)//2]*2:
        print(len(s)-i)
        exit()

Submission status: Accepted

Solution code:
def main():
    S = list(input())
    for i in range(1, len(S)-1):
        sub_str = S[:len(S)-i]
        if len(sub_str) % 2 == 1:
            continue
        elif sub_str[:int(len(sub_str)/2)] == sub_str[int(len(sub_str)/2):]:
            print(len(sub_str))
            break

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

i = len(s)
index = 0

while(1):
    i = i-1
    s = s[:i]
    if len(s) % 2 == 0:
        if s[:i//2] == s[i//2:]:
            index = i
            break
    if i == 0:
        break


print(index)

Submission status: Accepted

Solution code:
l = input()
n = len(l)

y = []
for i in range(1, int(n/2)):
    x = l[0:i*2]
    if x[0:int(len(x)/2)] == x[int(len(x)/2):]:
        y.append(len(x))
    
print(max(y))

Submission status: Accepted

Solution code:
l = input()
n = len(l)

x = 0
y = []
for i in range(1, int(n/2)):
    x = l[0:i*2]
    if x[0:int(len(x)/2)] == x[int(len(x)/2):]:
        y.append(len(x))
    
print(max(y))

Submission status: Accepted

Solution code:
def is_even_str(s):
    if len(s)%2 == 0 and s[:len(s)//2] == s[len(s)//2:]:
        return True
    else:
        return False

if __name__ == '__main__':
    S = input()
    S = S[:len(S)-1]
    while not is_even_str(S):
        S = S[:len(S)-1]
    print(len(S))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

S = input().strip()

for i in reversed( range(0,len(S),2) ):
  S=S[:-2]
  if S[:int(i/2)] == S[int(i/2):] :
    print(len(S))
    break

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(n):
  s = s[:-1]
  l = len(s)
  if len(s) % 2 == 0 and s[:l//2] == s[l//2:]:
    print(len(s))
    exit()

Submission status: Accepted

Solution code:
s = list(input())

while len(s) != 0:
  s.pop()
  if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
    print(len(s))
    exit()

Submission status: Accepted

Solution code:
s = list(input())

for i in range(len(s)):
    s.pop(-1)
    if len(s)%2==0:
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break

Submission status: Accepted

Solution code:
s=input()
l=len(s)-2
while True:
  if s[:l//2]==s[l//2:l]:
    print(l)
    break
  else:
    l-=2

Submission status: Accepted

Solution code:
s = list(str(input()))
for p in range(int(len(s))):
    del s[-1]
    t = int(len(s))
    if t % 2 == 0:
        for i in range(t//2):
            if s[i] != s[i+t//2]:
                break
        else:
            print(t)
            break

Submission status: Accepted

Solution code:
s = list(input())
while True:
    if len(s) % 2 != 0:
        s = s[:-1]
    else:
        s = s[:-2]
    if s[:len(s)//2] == s[len(s)//2:]:
        break
    if len(s) == 1:
        break

print(len(s))

Submission status: Accepted

Solution code:
def main():
    string = input()[:-1]
    while True:
        if len(string) % 2 == 0 and string[:len(string) // 2] == string[len(string) // 2:]:
            print(len(string))
            break
        else:
            string = string[:-1]


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = list(map(str, input()))

def symmetry(x):
    l = len(s)//2
    if x[l:] == x[:l]:
        return True
    else:
        return False
    
s.pop(-1)
while not(symmetry(s)):
    s.pop(-1)
    
print(len(s))

Submission status: Accepted

Solution code:
s = input()
x = len(s)
while x > 0:
    x -= 2
    s = s[:x]
    if s[:x//2] == s[x//2:]:
        print(x)
        break

Submission status: Accepted

Solution code:
import numpy as np

S = str(input())

import numpy as np

for i in range(1,int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i

    first_str = S[:j]
    second_str = S[j:2*j]
    if first_str == second_str:
        num = 2*j
        break
    elif (first_str != second_str) & (j==1):
        num = 0
        break

print(num)

Submission status: Accepted

Solution code:
s = input()

len_s = len(s)
for i in range(1, len_s):
    t = s[:len_s-i]
    len_t = len(t)
    if s[:len_t//2] == s[len_t//2:len_s-i]:
        print(len_t)
        break

Submission status: Accepted

Solution code:
S = input()
if len(S) % 2 == 1 :
    S = S[0 : len(S) - 1]
for i in range(len(S) - 2, 0, -2) :
    if S[0 : int(i / 2)] == S[int(i / 2) : i] :
        print(i)
        exit()

Submission status: Accepted

Solution code:
s=input()

def isg(s):
        if len(s)%2!=0:
                return False
        s1=s[:len(s)//2]
        s2=s[len(s)//2:]
        return s1==s2

while len(s) != 0:
        s=s[:-1]
        if isg(s):
                print(len(s))
                exit()

Submission status: Accepted

Solution code:
S = input()

for i in range(len(S) - 2, 0, -2):
    l = i // 2
    if S[:l] == S[l:i]:
        print(i)
        break

Submission status: Accepted

Solution code:
s = input()

ans = 0
for i in range(len(s)):
    if i == 0:
        s = s[:-1]
        continue
    else:
        a = len(s)
        t = s[a//2:]
        if s == t + t and len(s)%2 == 0:
            ans = 1
            break
        else:
            s = s[:-1]

print(len(s))

Submission status: Accepted

Solution code:
s=input()
if len(s)%2==1:
    s=s[:-1]
s_len=len(s)
for i in range(1,(s_len+1)//2):
    s=s[:-2]
    if s[:s_len//2-i]==s[s_len//2-i:]:
        print(s_len-2*i)
        break

Submission status: Accepted

Solution code:
s = input()
a = ""
b = ""
if len(s) % 2 == 1:
  s = s[:len(s)-1]
  a = s[:len(s)//2]
  b = s[len(s)//2:]
  if a == b:
    print(len(s))
    exit()

while len(s) > 0:
  s = s[:len(s)-2]
  a = s[:len(s)//2]
  b = s[len(s)//2:]
  if a == b:
    print(len(s))
    break

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
while True:
    if len(s) == 0:
        print(0)
        exit()
    if len(s)%2 == 0:
        half = len(s)//2
        if s[:half] == s[half:]:
            print(len(s))
            exit()
        else:
            s = s[:-2]
    else:
        s = s[:-1]

Submission status: Accepted

Solution code:
S = input()
ans = 0
for i in range(1, len(S)):
  s = S[: -2*i]
  l = (len(S) - 2*i) // 2
  if s[:l] == s[l:]:
    ans = len(S) - 2*i
    break
print(ans)

Submission status: Accepted

Solution code:
s = input()
while s:
    s = s[:-1]
    l = len(s)
    if l%2 == 1:
        continue
    if s[:l//2] == s[l//2:]:
        print(l)
        break

Submission status: Accepted

Solution code:
def judge(s):
    l=len(s)
    if l%2 ==0 and s[:l//2]==s[l//2:]:
        return True
    else:
        return False
s=input()
for i in reversed(range(1,len(s))):
    ns=s[:i]
    if judge(ns):
        print(len(ns))
        exit(0)

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
while True:
    x = len(s)//2
    if s[:x] == s[x:]:
        print(len(s))
        break
    else:
        s = s[:-1]

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

s = ns()
n = len(s)

ans = 0
for i in range(2, n, 2):
    flag = True
    m = i // 2
    for j in range(m):
        if s[j] != s[j + m]:
            flag = False
    if flag:
        ans = i

print(ans)

Submission status: Accepted

Solution code:
s=input()
while len(s)>0:
  s=s[:-2]
  a=len(s)
  if s[:(a//2)]*2==s:
    print(a)
    exit()

Submission status: Accepted

Solution code:
s = list(input())
s = s[:-1]  # 一文字とる
while True:
    n = len(s)
    if n % 2 == 1:
        s = s[:-1]
        continue
    a = n //2
    if s[:a] == s[a:]:
        print(n)
        exit()
    else:
        s = s[:-1]

Submission status: Accepted

Solution code:
s = input()[:-2]
n = len(s)//2+1
for i in range(n, 0, -1):
    if s[:i] == s[i:2*i]:
        print(2*i)
        break

Submission status: Accepted

Solution code:
s=input()

def is_guumoji(s):
    l=len(s)
    h=l//2
    s1=s[:h]
    s2=s[h:]
    if s1==s2: return True
    else: return False

s=s[:-2]
while 1:
    if is_guumoji(s):
        print(len(s))
        break
    else:
        s=s[:-2]

Submission status: Accepted

Solution code:
l = list(input())
for i in range(1,len(l)//2):
  l1 = l[:len(l)-2*i]
  if l1 == l1[:len(l)//2-i]*2:
    print(len(l1))
    exit()

Submission status: Accepted

Solution code:
# coding: utf-8
s=list(input())
n=len(s)
for i in range(n):
    del s[-1]
    del s[-1]
    n-=2
    if s[:n//2]*2==s:
        print(n)
        break

Submission status: Accepted

Solution code:
s = [x for x in input()]
if len(s) % 2 == 0:
    s = s[:-2]
while True:
    fin = 1
    half = len(s) // 2
    for i in range(half):
        if s[i] == s[half+i]: continue
        else:
            fin = 0
            s = s[:-2]
            break
    if fin: break
print(len(s))

Submission status: Accepted

Solution code:
S = input()
leng = len(S)
ans = 1
for i in range(leng-1, 0, -1):
    if S[:(i // 2)] == S[i // 2:i]:
        ans = max(i, ans)
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
while s:
  s.pop()
  l = len(s)
  if s[:l//2]*2 == s:
    break
print(l)

Submission status: Accepted

Solution code:
S = input()

t = (len(S) - 1) // 2 * 2
while True:
    if S[:t//2] == S[t//2:t]:
        break
    t -= 2
print(t)

Submission status: Accepted

Solution code:
s = input()
l = len(s)

for i in range(l)[::2]:
    if s[:-i-2] == s[:len(s[:-i-2])//2]*2:
        print(len(s[:-i-2]))
        exit()

Submission status: Accepted

Solution code:
S = input()
n = len(S)
ok = False
while not ok:
    n -= 2
    flag = True
    for i in range(n//2):
        if S[i] != S[i+n//2]:
            flag = False
    if flag:
        ok = True
print(n)

Submission status: Accepted

Solution code:
s=input()
n=len(s)
for i in range(n-2,-1,-2):
	s=s[:i]
	if s[:int(i/2)]==s[int(i/2):]:
		print(len(s))
		break

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    s = input()

    for i in range(len(s)-1, 1, -1):
        if i % 2 == 1:
            continue
        else:
            if s[0:i//2] == s[i//2:i]:
                print(str(i))
                break

Submission status: Accepted

Solution code:
s = input()

r = 0
while len(s) > 0:
  s = s[:-2]
  if s[:int(len(s)/2)] == s[int(len(s)/2):]:
    r = len(s)
    break
    
print(r)

Submission status: Accepted

Solution code:
S = input()

for i in range(1,len(S)):
    T = S[:-i]
    if len(T)&1:
        continue
    else:
        T1, T2 = T[:len(T)//2], T[len(T)//2:]
    if T1==T2:
        print(len(T))
        exit()

Submission status: Accepted

Solution code:
S=input()
s=""
s1=""
s2=""
for i in range(len(S)-1):
    s=S[:len(S)-i-1]
    if (len(s)%2==0):
        s1=s[:int(len(s)/2)]
        s2=s[int((len(s)+1)/2):]
        if s1==s2:
            print(len(s))
            break

Submission status: Accepted

Solution code:
def ss(s):

    ans = 0
    ss = s
    flag = True

    while flag:
        ss = ss[:int(len(ss)-2)]
        if ss[:int(len(ss)/2)] == ss[(int(len(ss)/2)):]:
            ans += len(ss)
            flag = False

    return ans

def main():
    s = str(input())
    print(ss(s))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

tmp = S

def check_rotate(tmp):
  a = tmp[0:len(tmp) // 2]
  b = tmp[len(tmp) // 2:]
  #print(a, b)
  if a == b:
    return len(a) * 2
  else:
    return 0

  
ans = 0
for i in range(1, len(S)-1):
  tmp = S[0:-i]
  if len(tmp) % 2 == 1:
    continue
  check_rotate(tmp)
  ans = max(ans, check_rotate(tmp))
print(ans)

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(n):
    s = s[:-1]
    n_ = len(s)
    if n_%2==0 and s[:n_//2] == s[n_//2:]:
        print(n_)
        break

Submission status: Accepted

Solution code:
s = input()[:-1]
if len(s) % 2 != 0:
    s = s[:-1]

for i in reversed(range(0, len(s)+2, 2)):
    half = i//2
    if s[:half] == s[half:]:
        print(len(s))
        break
    s = s[:-2]

Submission status: Accepted

Solution code:
s = input()
s = s[0:-1]
if len(s) % 2 != 0:
    s = s[:-1]

for i in reversed(range(0, len(s)+2, 2)):
    half = i//2
    if s[:half] == s[half:]:
        print(len(s))
        break
    s = s[:-2]

Submission status: Accepted

Solution code:
S = input()

s = []
for i in range(len(S)):
    s.append(S[i])
ans = 0

while(1):
    n = len(s)
    del s[n-1]
    a = ""
    b = ""
    n = len(s)
    if n%2==1:
        continue
    for i in range(n//2):
        a = a+s[i]
    for i in range(n//2):
        b = b+s[n//2+i]
    if a==b:
        ans = len(a)+len(b)
        break

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    S = list(input())
    for _ in range(len(S)):
        S.pop()
        if S[:len(S) // 2] == S[len(S) // 2:]:
            print(len(S))
            break


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
str = input()

def checkstr(str):
    if len(str) % 2 != 0: return False
    half = int(len(str) / 2)
    if str[0:half] == str[half:len(str)]: return True
    else: return False

for x in range(len(str) -1):
    answer = len(str) - (x + 1)
    check = checkstr(str[0:answer])
    if check == True: break
print(answer)

Submission status: Accepted

Solution code:
s = input()
ans = 0

while len(s) > 1:
  s = s[:-1]
  
  if len(s) % 2 != 0:
    continue
  
  m = len(s) // 2
  if s[:m] == s[m:]:
    break

print(len(s))

Submission status: Accepted

Solution code:
S=input()
N=len(S)
for j in range(1,N//2):
    M=N-2*j
    c=0
    for i in range(M//2):
        if S[i]==S[i+M//2]:
            c=c+1
    if c==M//2:
        print(M)
        break

Submission status: Accepted

Solution code:
S = input()

for i in range(1,len(S)):
    d = S[0:len(S)-i]
    if i %2 == 0:
        if d == d[0:(len(S)-i)//2] + d[0:(len(S)-i)//2]:
            e = len(S) - i
            break
print(e)

Submission status: Accepted

Solution code:
S=input()
N=len(S)
for j in range(1,N//2):
    M=N-2*j
    c=0
    for i in range(M//2):
        if S[i]==S[i+M//2]:
            c=c+1
    if c==M//2:
        print(M)
        break
if c==0:
    print(0)

Submission status: Accepted

Solution code:
s = input()
for i in range(2,len(s)-1, 2)[::-1]:
    t = s[:i]
    # print(i,t)
    if t[:i//2] == t[i//2:]:
        print(len(t))
        break

Submission status: Accepted

Solution code:
S=input()
for i in range(1,len(S)//2+1):
    check=0
    T=S[:len(S)-2*i]
    for j in range(0,len(T)//2):
        if T[j]!=T[j+len(T)//2]:
            check=1
    if check==0:
        print(len(T))
        break
if check==1:
    print(0)

Submission status: Accepted

Solution code:
s=list(input())
for x in range(len(s)-2,0,-2):
    t=s[0:x]
    a="".join(s[0:x//2])
    b="".join(s[x//2:x])
    if a==b:
        print(len(t))
        break

Submission status: Accepted

Solution code:
A = list(input())

count = 0
while A:
    A = A[:-2]
    lenght = len(A) // 2
    if A[lenght:] == A[:lenght]:
        count = lenght * 2
        break

print(count)

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
len_s = len(s)
for i in range(len_s):
    if len(s) % 2 == 1:
        s = s[:-1]
    elif s[0:int(len(s)/2)] == s[int(len(s)/2):len(s)]:
        print(len(s))
        break
    else:
        s = s[:-1]

Submission status: Accepted

Solution code:
S = input()

for _ in range(len(S)):
    S = S[:-1] # 末尾を削除
    if len(S) % 2 == 0:
        if S[:len(S)//2] == S[len(S)//2:]:
            ans = len(S)
            break

print(ans)

Submission status: Accepted

Solution code:
s=input()
n=len(s)
ans=0
while len(s)>0:
  s=s[:-2]
  ans+=2
  if s[:(n-ans)//2] == s[(n-ans)//2:]:
    print(n-ans)
    exit()

Submission status: Accepted

Solution code:
s = input()

S = s[:-1]

for i in range(len(s)):
    if len(S) % 2 == 0:
        c= len(S)//2
        a = S[0:c]
        b = S[c:len(S)]
        if a == b:
            print(len(s)-i-1)
            break
        else:
            S = S[:-1]
    else:
        S = S[:-1]

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s) - 1, 0, -1):
  s2 = s[:i]
  if not len(s2) % 2 == 0:
    continue
  
  mid = int(len(s2) / 2)
  if s2[0:mid] == s2[mid:]:
    print(len(s2))
    break

Submission status: Accepted

Solution code:
S = input()
for i in range(len(S)):
  sub_len = len(S) - i - 1
  substring = S[:sub_len]
  former = substring[:sub_len//2]
  latter = substring[sub_len//2:]
  if former == latter:
    print(sub_len)
    break

Submission status: Accepted

Solution code:
s = input()

for i in range(1,len(s)):
    if (len(s)-i) % 2 != 0: continue
    else :
        S = s[:-i]
        n = len(S)
        
        if S[0:n//2] == S[n//2:n]:
            print(n)
            exit()