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=input()
ans=0
flg=True
i=2 if len(s) % 2 == 0 else 1
while flg and i<len(s):
  t=s[:-i]
  if t[:len(t)//2]==t[(len(t)//2):]:
    ans = len(t)
    flg=False
  i+=2
print(int(ans))

Submission status: Accepted

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

for _ in range(len(s)):
    s = s[:-1]

    if len(s) % 2 == 0:
        length = len(s)
        if s[:length // 2] == s[length // 2:]:
            print(length)
            break

Submission status: Accepted

Solution code:
def main():
    S = input()
    
    for i in range(len(S) - 1) :
        S_ = S[:-(i+1)]
        if len(S_) % 2 == 0 :
            if S_[:len(S_)//2] == S_[len(S_)//2:] :
                print(len(S_))
                break
main()

Submission status: Accepted

Solution code:
S = input()


def f(S):
    idx = len(S) // 2
    sub1 = S[:idx]
    sub2 = S[idx:]
    return sub1 == sub2


for i in range(len(S) - 1, -1, -1):
    if f(S[:i]):
        print(i)
        exit()

Submission status: Accepted

Solution code:
S = input()

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

print(len(S))

Submission status: Accepted

Solution code:
S = input()

N = len(S)
import sys

for i in range(1,N-1):
    if i%2 == 0:
#         print(S[:(N+1-i)//2],S[(N+1-i)//2:N-i])
        if S[:(N+1-i)//2] == S[(N+1-i)//2:N-i]:
            print(N-i)
            sys.exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#4 0413
s = list(input())

for i in range(len(s)):
    s.pop()
    s.pop()
    num =int(len(s)/2)
    if s[:num] == s[num:]:
        print(len(s))
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().strip()
while True:
    s = s[:-2]
    le = len(s)
    half = len(s) // 2
    if (le % 2 == 0) and s[:half] == s[half:]:
        print(le)
        exit()

Submission status: Accepted

Solution code:
def check(a):
  n=len(a)
  if n%2:
    return -1
  else:
    if s[0:n//2]==s[n//2:n]:
      return 0
    else:
      return -1

s=input()
x=len(s)
for i in range(1,x):
  A=s[0:x-i]
  if check(A)==0:
    print(len(A))
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

len_s = len(s)

for i in range(int(len_s/2+1)):
    if i != 0:
        if s[0:int(-i+len_s/2)] == s[int(-i+len_s/2):(len_s-i*2)]:
            print(len_s-i*2)
            break

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
def guumoji(s):
    if len(s)%2 != 0:
        return False
    else:
        s1 = s[:int(len(s)/2)]
        s2 = s[int(len(s)/2):]
        if s1 == s2:
            return True
        else:
            return False
s = input()
i = 2
while i < len(s):
    s0 = s[:-i]
    if guumoji(s0):
        break
    else:
        i += 2
print(len(s0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    S = input()

    end = len(S) - 1
    while end >= 2:
        if isEvenStr(S[:end]):
            print(end)
            break
        end -= 1

def isEvenStr(s):
    if len(s) % 2 != 0:
        return False
    
    if s[:len(s)//2] == s[len(s)//2:]:
        return True
    else:
        return False

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
S = input()
N = len(S)
for i in range(2, N, 2):
    S = S[:-2]
    middle_idx = int(len(S)/2)
    left = S[:middle_idx]
    right = S[middle_idx:]

    if left == right:
        print(int(2*len(right)))
        break

Submission status: Accepted

Solution code:
S = input()

tail = 2
for i in range(1,len(S)//2):
    #print(S[0:len(S)//2-i])
    #print(S[len(S)//2-i:len(S)-tail])

    if S[0:len(S)//2-i] == S[len(S)//2-i:len(S)-tail]:
        print(len(S[0:len(S)//2-i]) * 2)
        exit()
    tail += 2

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
s = S[:N//2]
for _ in range(N//2):
    S.pop(-1)
    S.pop(-1)
    s.pop(-1)
    if s + s == S:
        break
print(len(S))

Submission status: Accepted

Solution code:
s = list(input())

while True:
    s.pop()
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        break

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())
    S = S[:-1]
    for _ in range(len(S)):
        l = len(S)
        if l % 2 == 0 and S[:l // 2] == S[l // 2:]:
            print(len(S))
            exit()
        else:
            S = S[:-1]


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())
    S = S[:-1]
    while S[:len(S) // 2] != S[len(S) // 2:]: S = S[:-1]
    print(len(S))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
def guu(s):
    if len(s)%2==1:
        return 0
    a=len(s)//2
    if s[0:a]==s[a:]:
        return 1
    else:
        return 0
s=list(input())
s.pop(-1)
while guu(s)==0:
    s.pop(-1)
print(len(s))

Submission status: Accepted

Solution code:
def gumoji(s):
    l=len(s)
    if s[:l//2]==s[l//2:]:
        return True
    return False
s=input()
n=len(s)

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

Submission status: Accepted

Solution code:
s = str(input())
n = len(s)-1
s = s[:n]
while 0 < n:
    if n % 2 == 0:
        if s[:n//2] == s[n//2:]:
            break

    n -= 1
    s = s[:n]

print(n)

Submission status: Accepted

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

for i in range(2, len_S+1, 2):
    check_S = S[:-i]
    len_check_S = len(check_S)
    half = len_check_S//2
    if check_S[:half] == check_S[half:]:
        print(len_check_S)
        break

Submission status: Accepted

Solution code:
S=input()
check=S
flg=0
P=list(check)
while True:
    P.pop(-1)
    P.pop(-1)
    naga=int(len(P)/2)
    for i in range(0,naga):
        if P[i]==P[naga+i]:
            flg=1
        else:
            flg=0
            break
    if flg==1:
        break
print(len(P))

Submission status: Accepted

Solution code:
S=input()
check=S
flg=0
check.rstrip()
check.rstrip()
P=list(check)
while True:
    P.pop(-1)
    P.pop(-1)
    naga=int(len(P)/2)
    for i in range(0,naga):
        if P[i]==P[naga+i]:
            flg=1
        else:
            flg=0
            break
    if flg==1:
        break
print(len(P))

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(2, N, 2):
    t = (N - i) // 2
    A = S[:t]
    B = S[t: N - i]
    if A == B:
        print(N - i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s = s[0:len(s)-2]
while True:
	count = len(s)
	n = count // 2
	front_s = s[0:n]
	back_s = s[n:count]
	if front_s == back_s:
		break
	s = s[0:count-2]
print(len(s))

Submission status: Accepted

Solution code:
s=list(input())
while(True):
    s.pop()
    s.pop()
    tmp=len(s)//2
    ans=0
    for i in range(tmp):
        if s[i]==s[i+tmp]:
            ans+=1
    if ans==tmp:
        print(tmp*2)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc066/tasks/abc066_b

S = input()
S_len = len(S)

while True:
    S = S[:S_len - 2]
    S_len = len(S)

    middle = S_len // 2

    if S[:middle] == S[middle:]:
        print(S_len)
        exit()

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())

    while True:
        del S[-1]
        ln = len(S)
        if ln % 2 == 0:
            l = "".join(S[:ln // 2])
            r = "".join(S[ln // 2:])
            if l == r:
                print(len(S))
                break


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

#import math
#mod = 10**9+7



def main():
  """s = input()
  s_l = len(s)
  L = list(set(list(s)))
  #print(L) ('a','b')
  L_l = len(L)
  comp = s[:s_l - 1]# first not comparable
  for i in range(s_l-1):
    i = 1
    for j in range(L_l): 
      if comp.count(L[j]) % 2 == 0:
        if i == len(L):
          print(len(comp))
          exit()
        else:
          i += 1
      else:
        comp = comp[:len(comp)-1]
  print(1)"""
  s=input()
  while True:
    s=s[:-1]
    k=len(s)
    if s[0:k//2]==s[k//2:]:
        print(k)
        exit()
if __name__ == '__main__':
  main()

Submission status: Accepted

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

maxlen = 0
for i in range(length//2-1):
  if s[0:(i+1)] == s[(i+1):2*(i+1)]:
    maxlen = 2*(i+1)
    
print(maxlen)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = list(input())

nS = S
i = 0

while len(nS) > 2:
    i += 1
    lns = len(S) - 2*i
    nS = S[:lns]
    nS1 = "".join(nS[:lns//2])
    nS2 = "".join(nS[lns//2:])
    if nS1 == nS2:
        print(len(nS))
        sys.exit()

print(1)

Submission status: Accepted

Solution code:
import sys
import numpy as np

input = input()
s = np.array([c for c in input])
ans = 0
for i in range(1, s.size):
    if s.size - i % 2 is not 0:
        if ''.join(np.array_split(s[0:s.size - i], 2)[0]) == ''.join(np.array_split(s[0:s.size - i], 2)[1]):
            ans = max(ans, s.size - i)
print(ans)

Submission status: Accepted

Solution code:
s = str(input())

t = len(s)
s = s[:t-1]
for _ in range(t):
    if len(s) % 2 != 0:
        s = s[:len(s)-1]
        continue
    if s[:(len(s)//2)] == s[len(s)//2:]:
        print(len(s))
        break
    else:
        s = s[:len(s)-2]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
while(len(S)>=1):
    del S[-1]
    if len(S)%2!=0:
        continue
    else:
        center = len(S)//2
        f_S = S[0:center]
        s_S = S[center:len(S)]
        #print(S, f_S, s_S)
        if f_S == s_S:
            ans = len(S)
            break
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=2
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def is_gg(s):
	if len(s)%2 == 1:
		return False
		
	mannaka=len(s)//2
	for a,b in zip(s, s[mannaka:]):
		if a!=b:
			return False
	return True
	
	
def main():
	s = input()
	for i in range(1, len(s)):
		if is_gg(s[:len(s)-i]):
			return len(s) - i
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(2, n, 2):
    head = s[:-i]
    is_ok = True
    for j in range(len(head)//2):
        if head[j] != head[j + len(head)//2]:
            is_ok = False
    if is_ok:
        print(len(head))
        break

Submission status: Accepted

Solution code:
S = input()

def gusuretu(S):
    if S[ : len(S) // 2] == S[len(S) // 2 : ]:
        return True
    else:
        return False

S = S[: len(S) - 1]
while True:
    if gusuretu(S):
        print(len(S))
        break
    S = S[:len(S) - 1]

Submission status: Accepted

Solution code:
s=input()

kazu = len(s)

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

Submission status: Accepted

Solution code:
s = input()

def func(x):

    center = len(x) // 2

    s1 = x[:center]
    s2 = x[center:]

    if s1 == s2:
        return len(x)
    else:
        return func(x[:-1])

ans = func(s[:-1])

print(ans)

Submission status: Accepted

Solution code:
# import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # queue
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    s = input()
    ans = 0
    for i in range(len(s)-2,-1,-1):
        if (i+1)%2==0:
            res = True
            for j in range((i+1)//2):
                if s[j]!=s[j+(i+1)//2]:
                    res = False
                    break
            if res:
                ans = i + 1
                break
    print(ans)
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
#abc066_b
def is_odd_str(str):
    length=len(str)
    if length%2==1:
        return False
    else:
        if str[:length//2]==str[length//2:]:
            return True
        else :
            return False
S = input()
rep = len(S)
for i in range(rep):
    S = S[:-1]
    if is_odd_str(S):
        print(len(S))
        break

Submission status: Accepted

Solution code:
def oddstirng(s):
    if len(s)%2!=0:
        return 0
    else:
        s1 = s[:len(s)//2]
        s2 = s[len(s)//2:]
        if s1!=s2:
            return 0
        else:
            return len(s)
            
S = input()[:-1]
while(True):
    # print(S)
    j = oddstirng(S)
    if j!=0:
        print(j)
        break
    else:
        S=S[:-1]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

for x in range(len(S) - 2, 1, -2):
    sliceX = S[0:x]
    firstX = sliceX[0:(x // 2)]
    laterX = sliceX[(x // 2):]
    if firstX == laterX:
        print(len(sliceX))
        break

Submission status: Accepted

Solution code:
s = input()
n = len(s)
ans = 0
for i in range(n//2):
    ok = True
    for j in range(i):
        if s[j] != s[i+j]:
            ok = False
    if ok:
        ans = i * 2
print(ans)

Submission status: Accepted

Solution code:
S = input()
N =len(S)
for i in reversed(range(2,N,2)):
    l = i//2
#    print(l,i)
#    print(S[:l],S[l:i])
    if S[:l] == S[l:i]:
        print(len(S[:i]))
        break

Submission status: Accepted

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

def stringcounter(M):
    if len(M)%2 ==0 and M[:len(M)//2]==M[len(M)//2:]:
        return True
    else:
        return False
while True:
    if stringcounter(S)==True:
        print(len(S))
        break
    else:
        S = S[:-1]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
for i in range(len(s)):
    s.pop()
    if len(s)%2==0:
        if s[:len(s)//2]==s[len(s)//2:]:
            print(len(s))
            exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

if len(s) %2 == 1:
  s.pop(-1)
else:
  s.pop(-1)
  s.pop(-1)

while len(s) != 0:
  l = len(s)
  if s[:l//2] == s[l//2:]:
    print(l)
    break
  s.pop(-1)
  s.pop(-1)

Submission status: Accepted

Solution code:
s=input()
s=s[:-1]
def Evenstring(str):
    if len(str)%2==0 and str[:len(str)//2]==str[len(str)//2:]:
        return True
    else:
        return False

while True:
    if Evenstring(s)==True:
        print(len(s))
        break
    else:
        s=s[:-1]
        #末尾の一文字を削除

Submission status: Accepted

Solution code:
s=input()
s=s[:-1]
def Evenstring(str):
    if len(str)%2==0 and str[:len(str)//2]==str[len(str)//2:]:
        return True
    else:
        return False

counter=0

while True:
    if Evenstring(s)==True:
        print(len(s))
        break
    else:
        s=s[:-1]
        #末尾の一文字を削除
    counter+=1    
    if counter>300:
        break

Submission status: Accepted

Solution code:
def evenStringChecker(s):
    mid = len(s) // 2
    if s[:mid] == s[mid:]:
        return True
    else :
        return False

S = input()

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

while True:
    flag = evenStringChecker(S)
    if flag :
        break
    S = S[:len(S)-2]

print(len(S))

Submission status: Accepted

Solution code:
S = str(input())
x = len(S)
for i in range(1,int(x/2)):
    ss = S[:(-2)*i]
    y = int(len(ss)/2)
    k = ss[:-y]
    if ss == k * 2:
        print(y*2)
        exit()

Submission status: Accepted

Solution code:
s=list(input())
ans=len(s)//2

if ans==1:
    print("1")
    exit()

while 1:
    del s[-2:]
    ans-=1
    if s[:ans]==s[ans:]:
        print(ans*2)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
for i in range(2,len(s),2):
    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 1:
	s=s[:-1]
	if len(s)%2==0 and s[:len(s)//2]*2==s:
		print(len(s))
		break

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    ans = 0
    flg = 0
    for i in range(1,len(s)-1,2):
        cpy_s = s[:i+1]
        cpy_size = i+1
        for j in range(cpy_size//2):
            if cpy_s[j] == cpy_s[j + cpy_size // 2]:
                continue
            else:
                flg = 1
                break
        if flg == 0:
            ans = cpy_size
        flg = 0
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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:
s = input()
for i in range(1, len(s)):
    t = s[:len(s)-i]
    if t[:len(t)//2]*2==t:
        print(len(s)-i)
        break

Submission status: Accepted

Solution code:
S = list(input())
for x in range(len(S) - 2):
  if len(S) % 2 != 0 or x == 0:
    S.pop(-1)
    continue
  i = len(S) // 2
  if S[:i] * 2 == S:
    break
  else: S.pop(-1)
print(len(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#create date: 2020-03-18 07:48

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    s = ns()
    s0 = s[0]
    n = len(s)
    m = (n-1)//2 + 1
    for i in range(1, m):
        if s[i] == s0:
            if s[:i] ==s[i:2*i]:
                ans = i*2
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

def evenStr():
    halfLen = len(S) // 2
    left = S[0:halfLen]
    right = S[halfLen:]
    if left == right:
        return True
    else:
        return False

while 1:
    strLen -= 2
    S = S[0:strLen]
    if evenStr():
        print(str(len(S)))
        break

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

s = list(STR())
for i in range(len(s)):
    s = s[:len(s) - 1]
    if len(s) % 2 == 0 and s[:len(s) // 2] == s[len(s) // 2:]:
        print(len(s))
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    s = input()
    lens = len(s)
    for i in range(1, lens // 2):
        sub = lens - 2 * i
        if s[:sub // 2] == s[sub//2:sub]:
            print(sub)
            break
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)
ans = 0
for i in range(1, N):
    s = S[:N-i]
    n = len(s)
    if n % 2 == 0:
        if s[:n//2] == s[n//2:]:
            ans = n
            break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = 1
for right in range(2, len(S)):
    T = S[: right]
    if T == S:
        break
    if len(T) % 2 == 0 and T[: len(T) // 2] == T[len(T) // 2:]:
        ans = max(ans, len(T))

print(ans)

Submission status: Accepted

Solution code:
S = input()
N = len(S)
for d in range(1,N-1):
    if (N-d)&1: continue
    m = (N-d)//2
    for i in range(m):
        if S[i] != S[m+i]: break
    else:
        print(N-d)
        exit()

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = list(input())
n = len(s)
ans = 0
while s:
    s.pop()
    ans +=1
    if len(s) % 2 == 0:
        m = len(s) // 2
        if s[0: m] == s[m:]:
            print(n-ans)
            exit()

Submission status: Accepted

Solution code:
def main():
    S = input()
    N = len(S)
    for i in range(1, N):
        s = S[:-i]
        M = len(s)
        if M % 2:
            continue
        if s[:M//2] == s[M//2:]:
            print(M)
            break


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = str(input())
n = len(s)
for i in reversed(range(n-1)):
    s_ = s[0:i]
    if len(s)%2 ==1:
        continue
    else:
        t = s_[0:(i//2)]
        if s_ == t + t:
            print(len(s_))
            exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = list(input())

s.pop()
while True:
    if len(s) % 2 == 1:
        s.pop()
    flag = True
    for i in range(len(s) // 2):
        if s[i] != s[i + len(s) // 2]:
            flag = False
    if not flag:
        s.pop()
    if flag:
        print(len(s))
        break

Submission status: Accepted

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