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())

for i in range(len(s)//2):
    s=s[:-2]
    key=0
    for i in range(len(s)//2):
        if(s[i]!=s[i+len(s)//2]):
            key=1
    if(key==0):
        print(len(s))
        exit()

Submission status: Accepted

Solution code:



def main():

    S = list(input())
    S= S[0:-2] if len(S)%2==0 else S[0:-1]
    while(True):

        half = len(S)//2
        if S[0:half]==S[half:]:
            print(len(S))
            exit()
        else:
            S = S[:-2]






if __name__ == "__main__":
    main()

Submission status: Accepted

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

if __name__ == "__main__":
	main()

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().rstrip()
n = len(s)
res = 2
for i in range(2, n, 2):
    t = s[:i]
    if t[:i // 2] == t[i // 2:]:
        res = i
print(res)

Submission status: Accepted

Solution code:
s=[i for i in input()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

S=input()
cnt=0
ct=0
while len(S)>0 and cnt==0:
	S=S[:-2]
	ct=0
	for i in range(len(S)//2):
		if S[i]==S[i+len(S)//2]:
			ct+=1
	if ct==len(S)//2:
		cnt+=1
		print(len(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    s = input()
    ls = len(s)
    for i in range(1, ls - 1):
        t = s[:-i]
        lt = len(t)
        if lt % 2 == 0 and t[:lt // 2] * 2 == t:
            print(lt)
            return 0


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
S=input()

for i in reversed(range(len(S) - 1)):
  if i % 2 == 1:
    moji1 = S[0:(i//2) + 1]
    moji2 = S[(i//2) + 1: i+ 1]
    
    if moji1==moji2:
      print(i+1)
      break

Submission status: Accepted

Solution code:
S = input()

LengthS = len(S)
for i in range(100):
    LengthS = LengthS - 2
    HalfS = int(LengthS / 2)
    if S[:HalfS] == S[HalfS:LengthS]:
        print(LengthS)
        break

Submission status: Accepted

Solution code:
def ss(s):
    return s[:len(s)//2] == s[len(s)//2:]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
i = 1
s = S
while s != "":
    s = S[:-2*i]
    L = len(s)
    if s[:L//2] == s[L//2:]:
        break
    i += 1
print(L)

Submission status: Accepted

Solution code:
S = input()
for i in range(2, len(S), 2):
    part_S = S[:-i]
    # print(part_S)
    mid = len(part_S) // 2
    left_S = part_S[:mid]
    right_S = part_S[mid:]
    if left_S == right_S:
        print(len(part_S))
        exit()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
h=len(s)
def ans(s):
    n=len(s)//2
    f=0
    for i in range(n):
        if s[i]!=s[i+n]:
            f+=1
            break
    if f==0:
        return True
    else:
        return False
      
s.pop(-1)
s.pop(-1)
kai=2
while not ans(s):
    s.pop(-1)
    s.pop(-1)
    kai+=2
print(h-kai)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())
N = N[:-1]

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


l = len(N)

# print(l)

r = int(l/2)
N_1 = N[0:r]
N_2 = N[r:l+1]

# print(N_1)
# print(N_2)

# print("______________________________________")

while l >= 2:
  if N_1 == N_2:
    # print("found: " + N_1)
    print(len(N_1)*2)
    break
  else:
    l = l-2
    r = int(l/2)
    N_1 = N[0:r]
    N_2 = N[r:l]
    # print(N_1)
    # print(N_2)

# print("not found")
    
  













##################################################

# l = list(str(input()))
# P = l

# # print(l[0])
# print(P[0])
# x = []
# s = []
# n = 0
# j = []
# for i in l:
#   x.append(i)
#   # "".join(x)
#   x = list(x)
#   j.append(x)

# j.insert(0,l[0])
# j.pop(-1)
# print(j)

Submission status: Accepted

Solution code:
s=input();print(max(i*(s[:i]==s[i:2*i])for i in range(len(s)//2))*2)

Submission status: Accepted

Solution code:
s=list(input())
for i in range(len(s)):
	s=s[:-2:]
	if len(s)%2!=0:continue
	l=len(s)//2
	if s[:l:]==s[l::]:
		print(l*2)
		exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

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

Submission status: Accepted

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

for i in range(n-2)[::-2]:
    half = i // 2
    head = s[0:half+1]
    tail = s[half+1:i+1]
    if head == tail:
        print(i+1)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

ns = len(S)

n=2

while n<=len(S):
    na = int((ns-n)/2)
    if S[0:na]==S[na:ns-n]:      
        print(ns-n)
        break
    n+=2

Submission status: Accepted

Solution code:
S=input()

L=len(S)

for i in range(1,L//2+1):
    if S[0:(L-2*i)//2]==S[(L-2*i)//2:-i*2]:
        print(L-2*i)
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    s = input().strip()
    # print(len(s))
    if len(s)&1:
        for i in range(len(s)-1, 0, -2):
            if s[:i//2] == s[i//2:i]:
                print(i)
                break
    else:
        for i in range(len(s)-2, -1, -2):
            if s[:i//2] == s[i//2:i]:
                print(i)
                break


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
S = input()
tmp = S[:]
for i in range(len(S)):
    tmp = S[:-i-1]
    if tmp[:len(tmp)//2] == tmp[len(tmp)//2:]:
        break
print(len(tmp))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

S = IS()
cnt = 0
max = 0
for i in range(len(S)//2):
    a = S[:i]
    b = S[i:2*i]
    if a == b and max < i:
        max = 2*i
print(max)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

M = [[0] * n for i in range(n)]
for i in range(1, n):
    M[0][i] = int(s[0] == s[i])

for i in range(1, n):
    for j in range(i+1, n):
        if s[i] == s[j] and M[i-1][j-1] + 1 <= j-i: 
            M[i][j] = M[i-1][j-1] + 1

M[n//2-1][n-1] = 0

#print(M)

ans = 0
for i in range(n):
    for j in range(i+1, n):
        if M[i][j] == j-i:
            ans = max(ans, j-i)

print(ans * 2)

Submission status: Accepted

Solution code:
n = list(input())
m = len(n)

for i in range(m):
    del n[-1]
    if len(n)%2 == 0:
        if n[0:(len(n)//2)] == n[(len(n)//2):(len(n)+1)]:
            print(len(n))
            break
    else:
        continue

Submission status: Accepted

Solution code:
s = input()
for i in range(len(s)):
    s = s[:len(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 = list(input())
while S:
  del S[-2:]
  T = S[len(S)//2:]
  if T == S[:len(S)//2]:
    print(len(S))
    break

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import copy
import  math
import bisect
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
ans = 1
for i in range(2, len(s), 2):
    c = s[:-i]
    l = len(c)
    if c[:l//2] == c[l//2:]:
        ans = max(l, ans)
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
s = list(input())
while True:
   s.pop()
   if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
       print(len(s))
       break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
while True:
    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 = input()
l = len(s)
h = l//2
if l == 3:
    print(1)
if l%2==0:
    for i in range(1,h):
        if s[0:h-i] == s[h-i:-2*i]:
            print(len(s[:-2*i]))
            break
else:
    for i in range(1,h):
        if s[0:h-i+1] == s[h-i+1:-2*i+1]:
            print(len(s[:-2*i+1]))
            break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC066b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

s = input()[:-1]


def isGu(st):
    if (len(st) % 2 != 0):
        return False
    flag = True
    for i in range(len(st) // 2):
        if (st[i] != st[i + len(st) // 2]):
            #print(i, i + len(st) // 2)
            flag = False
    return flag


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

Submission status: Accepted

Solution code:
def test():
    s = input()
    result = 0
    for i in range(len(s)-1):
        str = s[:i]
        if len(str) % 2 == 0:
            str1 = str[:len(str)//2]
            str2 = str[len(str)//2:]
            if all(str1[j] == str2[j] for j in range(len(str1))):
                result = max(result,len(str))
    print(result)


if __name__ == "__main__":
    test()

Submission status: Accepted

Solution code:
s=input()
l=len(s)
for _ in range(l):
  s=s[:-1]
  if(len(s)%2==1):
    continue
  if(s[:len(s)//2]*2==s):
    print(len(s))
    break

Submission status: Accepted

Solution code:
S =input()
del_flag = False
while True:
    if len(S) % 2 == 0 and del_flag == True:
        if S[:len(S)//2] == S[len(S)//2:len(S)]:
            print(len(S))
            exit()
    S = S[:len(S)-1]
    del_flag = True

Submission status: Accepted

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

# input
S = input()

# solve
for i in range(len(S)):
    S = S[:-1]
    if len(S) % 2 == 0 and S[:int(len(S)/2)] == S[int(len(S)/2):]:
        break

# output
print(len(S))

Submission status: Accepted

Solution code:
S = input()

L = len(S)

for l in range(L//2-1, -1, -1):
    if S[:l] == S[l:2*l]:
        print(2*l)
        break

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
s.pop()
s.pop()
while s[0:len(s)//2]*2 != s:
    s.pop()
    s.pop()
print(len(s))

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)//2

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    for l2 in range(len(S)-1, 0, -1):
        if l2 % 2 == 0:
            l = l2 // 2
            if S[:l] == S[l:2*l]:
                return l2
    return -1


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

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

def solve():
    for i in range(n - 2, 0, -2):
        if s[:(i//2)] == s[(i//2):i]:
            print(i)
            return
solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
s.pop()
while s[:len(s)//2] != s[len(s)//2:]: s.pop()
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
while True:
  s.pop()
  c = len(s)
  if s[:c//2] == s[c//2:]:
    print(c)
    exit()

Submission status: Accepted

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

S = input()

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

Submission status: Accepted

Solution code:
s = input()
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m"\
        , "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

ans = 0
i = 1
while i * 2 < len(s):
  if s[:i] == s[i:2 * i]: ans = i * 2
  i += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
while True:
    s.pop(-1)

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = list(input().rstrip())
while len(s)>0:
  
  s.pop()
    
  n = len(s)//2
  
  if s[:n] == s[n:] and len(s) % 2 == 0:
    print(len(s))
    break

Submission status: Accepted

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

Submission status: Accepted

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

import sys
input = sys.stdin.readline


def main():
    s = str(input()).replace("\n", "")

    for i in range(len(s) - 2, 0, -2):
        s_new = s[:i]
        if s_new[:int(len(s_new)/2)] == s_new[int(len(s_new)/2):]:
            print(len(s_new))
            return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()

while True:
    s = s[:-1]
    if len(s) % 2 == 1:
        continue

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

Submission status: Accepted

Solution code:
s=input()

def even():
  for i in range(2, len(s)+1, 2):
    l=int((len(s)-i)/2)
    if s[:l]==s[l:2*l]:
      return l*2

print(even())

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

if ans % 2 == 1:
    ans -= 1
else:
    ans -= 2

while ans > 0:
    if s[0:(ans//2)] == s[(ans//2):ans]:
        print(ans)
        exit()
    ans -= 2

Submission status: Accepted

Solution code:
s=input()

for i in range(len(s)//2):
    l=len(s)-2*i-2
    #lなど変数で置き換えればわかりやすい
    #print(s[:l//2])
    #print(s[l//2:l])
    if s[:l//2]==s[l//2:l]:
        print(l)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

for _ in range(len(s)):
  s=s[:-1]
  s_len=len(s)
  if s_len%2==0 and s[:s_len//2] == s[s_len//2:]:
    print(s_len)
    break

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(len(s)-1):
  x = s[:i+1]
  y = s[i+1:2*i+2]
  if x==y and x+y!=s:
    ans = len(x+y)
print(ans)

Submission status: Accepted

Solution code:
s = input()
m = 0
for i in range(len(s)):
    if (i + 1) % 2 == 0:
        t = s[:i+1]
        b = True
        for j in range(len(t) // 2):
            if t[j] != t[j+len(t)//2]:
                b = False
        if b:
            if s != t:
                m = max(m, len(t))
print(m)

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 = input()
N = len(S)
if N%2 == 1:
    N -= 1
else:
    N-=2
while(True):
    if(S[:N//2] == S[N//2:N]):
        print(N)
        exit(0)
    N -= 2

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
  s = s[:-1]
  half_f = s[int(len(s)/2):]
  half_l = s[:int(len(s)/2)]
  
  if len(s)%2 == 0 and half_f == half_l :
    print(len(s))
    break

Submission status: Accepted

Solution code:
def estr(s):
    if len(s) % 2 == 1:
        return False
    else:
        for i in range(len(s) // 2):
            if s[i] != s[i + len(s) // 2]:
                return False
    return True

s = input()

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

print(len(s))

Submission status: Accepted

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

while(flag):
    if len(s)%2==0:
        left=s[:len(s)//2] 
        right=s[len(s)//2:]
        if left==right:
            print(len(s))
            flag=False
        else:
            s=s[0:len(s)-1]
    else:
        s=s[0:len(s)-1]

Submission status: Accepted

Solution code:
s = list(input())
s.pop()
if len(s) % 2 !=0:
    s.pop()

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

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()
S = list(S)

if len(S) % 2 == 0 :
    S.pop()
S.pop()
    
while S :
    if S[:len(S)//2] == S[len(S)//2:] :
        print(len(S))
        break
    S.pop()
    S.pop()

Submission status: Accepted

Solution code:
A = str(input())
A = A[:-2]
N = len(A)
while A[:N//2] != A[N//2:]:
    A = A[:-2]
    N = len(A)
print(len(A))

Submission status: Accepted

Solution code:
S = input()

cnt = 0
while len(S) > 2:
    cnt += 1
    S = S[:-1]
    half = len(S)//2
    if S[:half] == S[half:]:
        print(len(S))
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

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

print (ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
# ss
def is_evenstring(s):
    if s[:len(s)//2] == s[len(s)//2:]:
        return True
    else:
        return False

# input
S = input()

# test
while True:
    S = S[0:-1]
    if is_evenstring(S):
        res = len(S)
        break

print(res)

Submission status: Accepted

Solution code:
S = input()
ans = 0
for i in range(len(S)-2)[::-1]:
    if i % 2 == 0:
        SL = S[:(i//2+1)]
        SR = S[(i//2+1):i//2+1+i//2+1]
        # print(SL, SR)
        if SL == SR:
            print((i//2+1)*2)
            exit()

Submission status: Accepted

Solution code:

s = input()
while True:
    s = s[0:-1]
    c = s[0:len(s)//2]
    if s == c*2:
        print(len(s))
        exit()

Submission status: Accepted

Solution code:
s = list(input())
flag=0

while flag==0:
  s.pop()
  if len(s)%2!=0:
    pass
  else:
    if "".join(s[:int(len(s)/2)]) == "".join(s[int(len(s)/2):]):
      flag=1
print(len(s))

Submission status: Accepted

Solution code:
s = input()
i = 0
x = 0
while len(s) != 0 and x == 0:
    s = s[:-1]
    if s[:int(len(s) / 2)] == s[int(len(s) / 2):]:
        x = 1
print(len(s))

Submission status: Accepted

Solution code:
S=input()
l=len(S)
while(1):
    S=S[:-2]
    l-=2
    p,n=S[:l//2],S[l//2:]
    if p==n:break
print(l)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(S: str):

    while True:
        S = S[:-2]
        if S[:len(S)//2] == S[len(S)//2:]:
            break
    print(len(S))
    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:
s=str(input())
while True:
    s=s[:-2]
    l=len(s)
    if s[:l//2]==s[l//2:]:
        print(l)
        break

Submission status: Accepted

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

for i in range(N-2, 1, -2):
    if S[:i//2] == S[i//2: i]:
        print(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()
n = len(s)
for _ in range(n-1):
  s = s[:-1]
  p = len(s) // 2
  pre = s[:p]
  pst = s[p:]
  if pre == pst:
    print(2*p)
    break

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
 

if len(s) % 2:
    s = s[:-1]
else:
    s = s[:-2]
    
cnt = len(s)
    
    
while True:
    if s[:len(s) // 2] == s[len(s) // 2:]:
        break
    s = s[:-2]
    cnt -= 2
 
 
print(cnt)