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:
l=list(input())
l.reverse()
s="".join(l)

for i in range(len(s)):
    s=s.replace(s[0],"",1)
    s1=s[:(len(s)//2)]
    s2=s[(len(s)//2):]
    if s1==s2:
        print(2*len(s1))
        exit()

Submission status: Accepted

Solution code:
S = str(input())
l = [str(x) for x in list(str(S))]
for i in range(int(len(l)/2)):
    l.pop(-1)
    l.pop(-1)
    tmp = "".join(l)
    if tmp[:int(len(l)/2)] == tmp[int(len(l)/2):]:
        print(len(l))
        break
    else:
        continue

Submission status: Accepted

Solution code:
s = input()

for i in range(2, len(s), 2):
    s0 = s[:(-1)*i]
    half = int(len(s0)/2)
    s1 = s0[:half]
    s2 = s0[half:]
    if s1 == s2:
        print(len(s0))
        break

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)
for i in range(l) :
    S.pop(-1)
    if i % 2 != 0 :
        A = S[0:len(S)//2]
        B = S[len(S)//2:len(S)]
        if A == B :
            print(len(S))
            break

Submission status: Accepted

Solution code:
S=input()

buf=list(S)

result=0

for i in range(len(S)):
    del buf[-1]
    if(len(buf)%2==0):
        tmp="".join(buf[0:int(len(buf)/2)])
        if "".join(buf).count(tmp)==2:
            result=len(buf)
            break

print(result)

Submission status: Accepted

Solution code:
S = list(input())
before = S[:len(S) // 2]
after = S[len(S) // 2:]
for i in range(len(S) // 2):
    tmp = before.pop(-1)
    after.insert(0 , tmp)
    after.pop(-1)
    after.pop(-1)
    if before == after:
        break
print(len(before) * 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
S=input()

for i in range(len(S)):
    tmp=S[:-i-2]
    if len(tmp)%2!=0:
        continue
    else:
        tmp=list(tmp)
        tmp=list(np.array_split(tmp,2))
        if (tmp[0]==tmp[1]).all():
            break

print(len(tmp[0])*2)

Submission status: Accepted

Solution code:
s = input()

leng = len(s)

for i in range(110):
	if s[0:int((leng-2)/2)] == s[int((leng-2)/2):leng-2]:
		print(leng-2)
		break
	else:
		leng = leng - 2

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge_ss(word):
    l = len(word)
    
    if l % 2 != 0:
        return 0
    
    for i in range(l//2):
        if word[i] != word [i+l//2]:
            return 0

    return 1
    
S = list(input())
l = len(S)

ans = 0

for i in range(1,l-1):
    if judge_ss(S[:l-i]):
        print(len(S[:l-i]))
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

Solution code:
S = input()
ans = None

for i in range(len(S) - 1, -1, -1):
    t = S[:i]
    size = len(t) // 2
    if t[:size] == t[size:]:
        ans = len(t)
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
ans = 0
for i in range(1,len(s)):
  if i % 2 != 0:
    s.pop()
    continue
  else:
    s.pop()
    s1 = s[0:(len(s)//2)]
    s2 = s[(len(s)// 2) :]
    if s1 == s2:
      ans = len(s)
      break
print(ans)

Submission status: Accepted

Solution code:
S=input() # 偶文字列
lenS=len(S) # Sの長さ
i=0 # 削る量

# 削ってゆき、長さが0になったら終了、今回は解があることが保証されているので特別な処理はなし
while i<lenS:
    i+=1 # 削る量を増やしてゆく
    Si=S[:lenS-i] # Sを削ってゆく
    lenSi=len(Si) # 削った結果の長さ

    if lenSi%2==1: # もし長さが奇数の場合、次へ
        continue

    if Si[:lenSi//2]==Si[lenSi//2:]: # 偶文字列なら終了
        break

print(lenSi)

Submission status: Accepted

Solution code:
#ss
S = input()
for _ in range(len(S)):
    S = S[0:len(S)-2]
    if S[0:len(S)//2] == S[len(S)//2:len(S)]:
        break
    else:
        pass
print(len(S))

Submission status: Accepted

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

if len(s)%2 == 0:
    s = s[:-2]
else:
    s = s[:-1]

while True:
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        exit()
    s = s[:-2]

Submission status: Accepted

Solution code:
S = str(input())

for i in range(len(S)):
    A = S[:len(S) - i - 1]
    if len(A) % 2 == 0:
        X = len(A) // 2
        if A[:X] == A[X:]:
            print(len(A))
            break

Submission status: Accepted

Solution code:
words = list(input())

def is_even_word(s):
  s_len = len(s)
  if s_len % 2 != 0:
    return False
  h = int(s_len/2)
  return s[:h] == s[h:]

l = len(words) - 1
for s in words:
  word = words[:l]
  if is_even_word(word):
    print(l)
    exit(0)
  l -= 1

print(0)

Submission status: Accepted

Solution code:
S = input()
S = S[:len(S)-1]
while(True):
    A = S[:int(len(S)/2)]
    B = S[int(len(S)/2):]
    if(A == B):
        print(len(S))
        break
    S = S[:len(S)-1]

Submission status: Accepted

Solution code:
s = input()

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

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 0
N = len(S)
for i in range(1,N):
    tmp = S[0:N-i]
    M = len(tmp)
    if M % 2 != 0:
        continue
    flg = False
    for k in range(M//2):
        if tmp[k] != tmp[M//2+k]:
            flg = False
            break
        flg = True
    if flg:
        print(M)
        exit()

Submission status: Accepted

Solution code:
s = input()
length = len(s)
count = 0
for i in range(len(s)) :
    s = s[:-1]
    count += 1
    if len(s) % 2 == 1:
        continue
    elif s[:len(s) // 2] == s[len(s) // 2:] :
        print(length-count)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

while True:
    S = S[:-2]
    n = len(S)
    if S[:int(n/2)] == S[int(n/2):]:
        print(n)
        exit()

Submission status: Accepted

Solution code:
s=list(input())
while s!=[]:
    s.pop(len(s)-1)
    if len(s)%2==1:
        continue
    else:
        if s[:len(s)//2]==s[len(s)//2:]:
            print(len(s))
            break

Submission status: Accepted

Solution code:
S = input()

while True:
    S = S[:-2]
    n = len(S)
    if S[:int(n/2)] == S[int(n/2):]:
        print(n)
        print
        exit()

Submission status: Accepted

Solution code:
def chk(s):
    if len(s) % 2 == 0 and s[len(s)//2:] == s[:len(s)//2]:
        return 1
    return 0

S = input()
for i in range(len(S))[::-1]:
    if chk(S[:i]):
        print(i)
        break

Submission status: Accepted

Solution code:
def examB():
    St = S()
    N = len(St)
    is_evenl = True
    cur = 0
    for i in range((N-1)//2):
        is_evenl = True
        for j in range(i+1):
            if St[j]!=St[i+j+1]:
                is_evenl = False
#                print(j, i + j + 1)
        if is_evenl:
            cur = (i+1)*2
    print(cur)


import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

Solution code:
a=input()
tmp=0
ans=0
for i in range(len(a)-1):
    a=a[:-1]
    if len(a)%2==0:
        x=int(len(a)/2)
        if a[:x]==a[x:]:
            tmp=len(a[:x])*2
            ans=max(tmp,ans)
print(ans)

Submission status: Accepted

Solution code:
# ABC 066: B – ss
s = input()
is_even_string = False

s = s[:-1]
while not is_even_string:
    if len(s) % 2 == 0:
        if s[:len(s) // 2] == s[len(s) // 2:]:
            is_even_string = True
    s = s[:-1]

print(len(s) + 1)

Submission status: Accepted

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

for i in range(1,len(S)//2+1):
  if S[:i] == S[i:i*2]: ans = i
print(ans*2)

Submission status: Accepted

Solution code:
s = list(input())

while len(s) >= 0:
    s.pop(-1)
    s.pop(-1)
    length = len(s)
    head = s[:(length//2)]
    tail = s[(length//2):]
    if head == tail:
        print(len(head) + len(tail))
        exit()

Submission status: Accepted

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

for i in range(letters):
    letter_2 = letters - (i + 1)
    s = S[:letter_2]
    if s[:(letter_2 // 2)] == s[(letter_2 // 2):]:
        print(len(s))
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
while len(S) > 2:
    S = S[:-2]
    S_l = S[:len(S)//2]
    S_r = S[len(S)//2:]
    if S_l == S_r:
        print(len(S))
        break

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

s = input()
n = len(s)
for i in range(n):
    tmp = s[:-1-i]
    l = len(tmp)
    if l%2:
        continue
    if tmp[:l//2] == tmp[l//2:]:
        print(l)
        break

Submission status: Accepted

Solution code:
def ss(s):
    n=len(s)
    if n%2==1:
        return False
    else:
        m=n//2
        s1=s[:m]
        s2=s[m:]        
        for i in range(m):
            if s1[i]!=s2[i]:
                return False
        return True

S=input()
for i in range(1,len(S)):
    if ss(S[:-i]):
        print(len(S)-i)
        break

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()
while len(s)>1:
  s = s[:-1]
  h = int(len(s)/2)
  if s[:h]==s[h:]:
    print(len(s))
    exit()

Submission status: Accepted

Solution code:
S = input()
len_s = len(S)
for i in range(2, len_s, 2):
    deleted_str = S[:-i]
    center = (len_s - i) // 2
    mae = deleted_str[:center]
    ato = deleted_str[center:]
    if mae == ato:
        print(len(deleted_str))
        break

Submission status: Accepted

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

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:
st=input()
s=list(st)
if len(st)==2:print(1)
else:
  for i in range(len(s)):
    s.pop();s.pop()
    if s[0:len(s)//2]==s[len(s)//2:]:
      print(len(s))
      exit()

Submission status: Accepted

Solution code:
s=list(input())
while True:
    s.pop(-1)
    l = len(s)
    if l%2==0:
        forward = s[:l//2]
        backword = s[l//2:]
        if forward==backword:
            print(len(forward)*2)
            exit()
    else:
        continue

Submission status: Accepted

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

s = input().rstrip()     # rstrip() がないとダメ
if len(s) % 2 == 1: s = s[:-1]
else: s = s[:-2]

for _ in range(len(s) // 2):
    if s.count(s[:len(s) // 2]) == 2: print(len(s));  exit()
    else: s = s[:-2]
print(0)

Submission status: Accepted

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    for i in range(len(S)-1):
        new_s = S[:len(S) - i - 1]
        if len(new_s) % 2 != 0:
            continue
        half = len(new_s) // 2
        front = new_s[:half]
        tail = new_s[half:]

        if front == tail:
            return len(new_s)
    return 0


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

Solution code:
#066b
S = str(input())

S = list(S)

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

Submission status: Accepted

Solution code:
S = list(input())
if len(S)%2 != 0:
    del S[-1]
else:
    del S[-1]
    del S[-1]
while S[:int(len(S)/2)] != S[int(len(S)/2):]:
    del S[-1]
    del S[-1]
print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
while True:
  S=S[:-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()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()[:-1]

while True:
    s_len = len(S)
    if s_len % 2 == 0:
        if S[:s_len//2] == S[s_len//2:]:
            print(s_len)
            break
        else:
            S = S[:-2]
    else:
        S = S[:-1]

Submission status: Accepted

Solution code:
slis=list(map(str,input()))
max=0
for i in range(int(len(slis)//2)):
	if slis[0:i]==slis[i:2*i]:
		max=i
print(2*max)

Submission status: Accepted

Solution code:
S=list(input())
S.pop()

ans=0
for i in range(len(S)):
    if S[:i]==S[i:i*2]:
        ans=i

print(ans*2)

Submission status: Accepted

Solution code:
S = list(input())

while True:
    S.pop()
    if len(S) % 2 != 0:
        continue
    temp = ''.join(S)
    if temp[:int(len(S)/2)] == temp[int(len(S)/2):]:
        print(len(S))
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

count = len(s) - 1
ans = 0

while count > 0:
    # print(
    #     "s[0 : count // 2] ,s[count // 2 :]", s[0 : count // 2], s[count // 2 : count]
    # )
    if count % 2 == 0:
        if s[0 : count // 2] == s[count // 2 : count]:
            ans = max(ans, count)
    count -= 1

print(ans)

Submission status: Accepted

Solution code:
# ABC066 B - ss
S = input()
N = len(S)
ans = 0
for i in range(1,N):
    ss = S[0:N-i]
    if len(ss)%2 == 1:
        continue
    n = len(ss)//2
    sf = ss[0:n]
    st = ss[n:N+1]
    if sf == st:
        ans = max(ans,len(ss))

print(ans)

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
for i in range(len(s)):
    r = len(s)
    if r %2 == 0:
        if s[:r//2] == s[r//2:]: #同じ配列の繰り返しだから半分ずつも同じものになっている
            print(len(s))
            break
        else:
            s = s[:-1]
    else:
        s = s[:-1]

Submission status: Accepted

Solution code:
#2019/10/17
S = open(0).read()
if len(S)%2 != 0:
    S=S[:-3]
else:
    S=S[:-2]
for i in range(int(len(S)/2)):
    #print("S=",S)
    #print(S[:int(len(S)/2)])
    #print(S[int(len(S)/2):])
    if S[:int(len(S)/2)] == S[int(len(S)/2):]:
        print(len(S))
        break
    else:
        S=S[:-2]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
len_s = len(s)
for count in range(1, len_s+1):
  sub_s = s[:-count]
  if len(sub_s) % 2 == 0:
    half_len_sub = int(len(sub_s) / 2)
    if sub_s[:half_len_sub] == sub_s[half_len_sub:]:
      print(len_s - count)
      exit()

Submission status: Accepted

Solution code:
s=str(input())[:-1]
if len(s)%2!=0:
    s=s[:-1]
a=len(s)//2
for i in range(len(s)):
    if s[0:a]==s[a:]:
        print(a*2)
        break
    else:
        a-=1
        s=s[:-2]

Submission status: Accepted

Solution code:
s,i=input(),1
while s[:(len(s)-2*i)//2] != s[(len(s)-2*i)//2:-2*i]:i += 1
else:print(len(s)-2*i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def ok(s):
  n = len(s) 
  if n % 2 == 1:
    return False
  else:
	#print(s[0:n//2] + " " + s[n//2:])
    return s[0:n//2] == s[n//2:]

for i in range(1, len(S)+1):
  if ok(S[0:len(S)-i]):
    print(len(S)-i)
    break

Submission status: Accepted

Solution code:
S = list(input())

for i in range(1,len(S),2):
    m = int((len(S) - i) / 2)
    a = S[:m]
    b = S[m:len(S)-i-1]
    if(a == b):
        print(len(a)+len(b))
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
lenS=len(S)
ans=0

if lenS%2==0:
  for l in range(lenS//2-1):
    check=0
    for k in range(l+1):
      if S[k]==S[k+l+1]:
        check+=1
    if check==l+1:
      ans=check*2
  print(ans)

else:
  for l in range(lenS//2):
    check=0
    for k in range(l+1):
      if S[k]==S[k+l+1]:
        check+=1
    if check==l+1:
      ans=check*2
  print(ans)

Submission status: Accepted

Solution code:
s=input()

s=s[:-1]
half=len(s)//2
while s[:half]!=s[half:]:
    s=s[:-1]
    half=len(s)//2
    
print(len(s))

Submission status: Accepted

Solution code:
s = list(input())

while len(s) > 1:
  last_char = s.pop(-1)
  len_str = len(s)
  if(len_str % 2 != 0):
    continue
  if(s[0:len_str//2] == s[len_str//2:]):
    print(len(s))
    exit()

Submission status: Accepted

Solution code:
S = input()
S = S[:-1]

half = len(S)//2
while S[:half] != S[half:]:
    S = S[:-1]
    half = len(S)//2

print(len(S))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(int(1e6))

S = input()

ans = 0
for n in range(len(S)-1, 1, -1):
  if n % 2:
    continue
  s = S[0:n]
  m = n // 2
  #print(s, n, m, s[0:m])
  if s[0:m] == s[m:n]:
    ans = n
    break
  
print(ans)

Submission status: Accepted

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

for i in range(len(s)):
    n=len(s)
    if s[:n//2]==s[n//2:]:
        print(n)
        break
    else:
        s=s[:-2]
else:
    print(-1)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    s = s[:len(s)-1]
    while True:
        if len(s) % 2 == 0:
            if s[:len(s)//2] == s[len(s)//2:]:
                print(len(s))
                exit()
        s = s[:len(s)-1]


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
for i in reversed(range(2, len(s), 2)):
  news = s[:i]
  lns = len(news)
  if news[:lns//2] == news[lns//2:]:
    print(i)
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
ans=""
import math
for i in range(1,n):
    if i%2==1:
        continue
    ss=s[:i]
    m=len(ss)
    p=0
    for j in range(m//2):
        if ss[j]!=ss[j+m//2]:
            p=1
            break
    if p==0:
        ans=ss
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
while len(s)%2!=0 or 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(len(s)):
  s = s[:-2]
  if s[:len(s)//2] == s[len(s)//2:]:
    print(len(s))
    exit()

Submission status: Accepted

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

for i in range(len(s)):
    s_1=s[:len(s)//2]
    s_2=s[len(s)//2:]
    if all(s.count(x)%2 == 0 for x in s) and s_1 == s_2 or len(s) == 2:
        print(len(s))
        break
    else:
        s=s[:-1]

Submission status: Accepted

Solution code:
S=input()
# 2文字ずつ消していく。偶数か奇数か判別
def ss(S):
    if len(S)%2==0:
        # 偶数
        for i in range(2,len(S),2):
            s=S[:len(S)-i]
            #print(s)
            if s[:len(s)//2]==s[len(s)//2:]:
                return print(len(s))
    else:
        # 奇数
        for i in range(1,len(S),2):
            s=S[:len(S)-i]
            #print(s)
            if s[:len(s)//2]==s[len(s)//2:]:
                return print(len(s))
    return

ss(S)

Submission status: Accepted

Solution code:
s = input()

while True:
    s = s[:len(s) - 1]
    if len(s) % 2 != 0:
        continue
    mid = len(s) // 2
    if s[:mid] == s[mid:]:
        print(len(s))
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s=input()
    s=s[:-2]
    ans = len(s)
    while s[:len(s)//2] != s[len(s)//2:] and len(s)!=0:
        s=s[:-2]
        ans -=2
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=[i for i in input()]
for i in range(len(s)-1):
    s.pop(-1)
    x=len(s)//2
    if len(s)==1:print(1)
    elif s[:x]==s[x:]:
        print(x*2)
        break

Submission status: Accepted

Solution code:
inputStr = list(input())
def evenStrJudg(s):
  sameCheck = True
  if len(s) % 2 != 0:
    sameCheck = False
  else:
    for i in range(int(len(s) / 2)):
      if s[i] != s[i + int(len(s) / 2)]:
        sameCheck = False
        break
  return sameCheck

for i in range(int(len(inputStr) / 2)):
  del inputStr[-1]
  del inputStr[-1]
  if evenStrJudg(inputStr):
    break
print(len(inputStr))

Submission status: Accepted

Solution code:
s = input()

def is_even(s):
    for i in range(len(s) // 2):
        if s[i] != s[i + len(s) // 2]:
            return False
    return True

for i in range(len(s) - 2, 0, -2):
    if is_even(s[0:i]):
        print(len(s[0:i]))
        break

Submission status: Accepted

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

while len(s)>1:
  if len(s)%2 == 0:
    s_1 = s[:len(s)//2]
    s_2 = s[len(s)//2:]
    if s_1 == s_2:
      ans = len(s)
      break
      
  s = s[:-1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S = input()
S = S[:-1]
for _ in range(len(S)):
    len_s = len(S)
    if len_s%2 == 0:
        s1 = S[:int(len_s/2)]
        s2 = S[int(len_s/2):len_s]
        if s1 == s2:
            print(len_s)
            sys.exit()
        else:
            S = S[:-1]
    else:
        S = S[:-1]

Submission status: Accepted

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

if s % 2 != 0:
    S = S[:-1]
    s = len(S)
else:
    S = S[:-2]
    s = len(S)

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

Submission status: Accepted

Solution code:
S = list(input())
if len(S)%2 == 0:
    del S[-1]
    del S[-1]
    for i in range(len(S)):
        if S[0:(len(S))//2] == S[(len(S))//2::]:
            print(len(S))
            break
        else:
            del S[-1]
            del S[-1]
else:
    del S[-1]
    for i in range(len(S)):
        if S[0:(len(S))//2] == S[(len(S))//2::]:
            print(len(S))
            break
        else:
            del S[-1]
            del S[-1]

Submission status: Accepted

Solution code:
S=input()
N=len(S)-1
i=0
while(True):
    s=S[0:N-i]
    n=len(s)
    if n%2==0:
        if s[0:int(n/2)]==s[int(n/2):n]:
            print(N-i)
            break
    i+=1

Submission status: Accepted

Solution code:
#B問題
S = list(str(input()))
N = len(S)
front = []
back = []
for i in range(N):
    if i < N//2:
        front.append(S[i])
    else:
        back.append(S[i])


for i in range(N):
    #print(front,back)
    del back[-1]
    if i%2 == N%2:
        f = front.pop(-1)
        back.insert(0,f)
    if front == back:
        MAX = (N-i-1)
        break
        
print(MAX)

Submission status: Accepted

Solution code:
s = input()
for i in range(2, len(s), 2):
    end = len(s) - i
    half = end // 2
    if s[:half] == s[half:end]:
        ans = end
        break
print(ans)

Submission status: Accepted

Solution code:
s = input()[:-2]
while True:
    # print('Check',s)
    p = int(len(s)/2)-1
    # print('Divided into',s[:p+1],s[p+1:])
    if s[:p+1] == s[p+1:]:
        break
    s = s[:-2]
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
c=[]
for i in range(1,len(S)//2+1):
    if S[0:i]==S[i:2*i]:
        c.append(S[0:i])


for i in range(1,len(c)+1):
    if c[-i]*2 in S[0:len(S)-1]:
        print(len(c[-i]*2))
        break

Submission status: Accepted

Solution code:
S = input()
end_idx = len(S)-2
S = S[:end_idx]
while len(S):
  if S[:len(S)//2] == S[len(S)//2:]:
    print(len(S))
    exit()
  else:
    end_idx = len(S)-2
    S = S[:end_idx]

Submission status: Accepted

Solution code:
s = list(input())
n = len(s) - 1
key = "F"
for i in range(n):
    if n % 2 == 0:
        key = "T"
        for i in range(n//2):
            if s[i] != s[i+n//2]:
                key = "F"
        if key == "T":
            print(n)
            break
        else:
            n -= 1
    else:
        n -= 1

Submission status: Accepted

Solution code:
s=input()
ans=float("inf")
for i in range(1,len(s)):
  nagasa=len(s)-i
  if nagasa%2==0:
    if s[0:(nagasa//2)]==s[(nagasa//2):nagasa]:
      print(nagasa)
      exit()

Submission status: Accepted

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