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())
s = s[::-1]

del s[:2]
l = len(s)

while any(s[i] != s[l//2 + i] for i in range(l//2)):
    del s[:2]
    l = len(s)

print(l)

Submission status: Accepted

Solution code:

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

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return np.array(x)

S = input()

N = len(S)

List = []

for i in range(0,int(N/2)):
    List.append([S[0:i+1],S[i+1:2*i+2]])

del List[-1]

for a in List[::-1]:
    if a[0] == a[1]:
        print(2*len(a[0]))
        exit()

Submission status: Accepted

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

for i in range(2, n, 2):
    left = int((n-i)/2)
    tmp1 = s[0:left]
    tmp2 = s[left:n-i]
    if (tmp1 == tmp2):
        print(left * 2)
        break

Submission status: Accepted

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

Submission status: Accepted

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

S = input()[:-1]

if len(S) < 2:
    ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
for i in reversed(range(n-1)):
    if i%2:
        l=s[:i//2+1]
        r=s[i//2+1:i+1]
        ok=True
        for j in range(i//2+1):
            if l[j]!=r[j]:
                ok=False
        if ok:
            print(i+1)
            exit()

Submission status: Accepted

Solution code:
from sys import exit

s = input()

for i in range(len(s)-1, -1, -1):
    if i % 2 == 1:
        continue

    flag = True
    for j in range(i // 2):
        if s[j] != s[i//2+j]:
            flag = False
    
    if flag:
        print(i)
        exit()

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    s = input()
    len_s = len(s)
    for i in range(2, len_s-1, 2):
        len_s -= 2
        left = s[:len_s//2]
        right = s[len_s//2:len_s]
        if left == right:
            break
    print(len_s)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def is_even(s):
    if len(s) % 2 == 1:
        return False
    mid = len(s) // 2
    if s[:mid] == s[mid:]:
        return True
    return False

def main():
    S = input().strip()
    S = S[:len(S)-2]
    while len(S) > 2:
        if is_even(S):
            break
        else:
            S = S[:len(S)-2]
    print(len(S))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()
res=0

def doubleCheck(moji):
  n = len(moji)//2
  if len(moji) % 2 ==1:
    return False
  else:
    if moji[0:n] == moji[n:len(moji)]:
      return True
    else:
      return False

for i in range(len(S)):
  S = S[0:len(S)-1]
  if doubleCheck(S):
    res = len(S)
    break
print(res)

Submission status: Accepted

Solution code:
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))
        exit()

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
S = input()

front_str = ''
back_str = ''
result = 0
for i in range(2, len(S)-1, 2):
    front_str = S[:int(i/2)]
    back_str = S[int(i/2):i]
    tmp_len = 0
    if front_str == back_str:
        tmp_len = i
        result = max(result, tmp_len)

print(result)

Submission status: Accepted

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

while n>1:
    
    if n%2==0:        
        s=s[:n]

        tmp1=s[:n//2]
        tmp2=s[n//2:]

        if tmp1==tmp2:
            print(n)
            exit(0)
    
    n-=1

Submission status: Accepted

Solution code:
def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()
    
    s = input()
    n = (len(s)-1)//2
    ans = 0
    for i in range(1,n+1):
        if (s[:i] == s[i:2*i]):
            ans = 2*i
    print(ans)




if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s = input()
n = len(s)
for i in range(1,n):
    m = n - i
    if m % 2 > 0:
        continue
    if s[:m//2] == s[m//2:m]:
        print(m)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
M = input()
MM = list(M)
count = 0
x = len(MM)
while count == 0:
  if len(MM)%2 ==1:
    MM.pop(-1)
  else:
    a = int(len(MM)/2)
    
    if MM[:a] == MM[a:] and len(MM) != x:
        count =1
    else:
      MM.pop(-1)
print(len(MM))

Submission status: Accepted

Solution code:
s = input()
n = len(s)
idx = 1
while idx < n:
    sub_s = s[: n - idx]
    if sub_s == sub_s[: len(sub_s) // 2] * 2:
        break
    idx += 1

print(n - idx)

Submission status: Accepted

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

Submission status: Accepted

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

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()[:-2]
while s[:len(s)//2] != s[len(s)//2:]:
    s=s[:len(s)-2]
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def evenstr(x):
    box1 = []
    box2 = []
    if len(x) % 2 == 1:
        return False
    else:
        v = int(len(x) / 2)
        for i in range(v):
            box1.append(x[i])
        for i in range(v, len(x)):
            box2.append(x[i])
        if box1 == box2:
            return True
        else:
            return False

    

count = 0
s = input()
p = list(s)
p.pop()
count += 1

for i in range(len(p) - 2):
    if evenstr(p):
        break
    else:
        count += 1
    p.pop()

print(len(p))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

s=s[:len(s)-1]
l=len(s)
if l%2==0:
  for i in range(0,l+1,2):
    x=s[:l-i]
    if x[:len(x)//2] == x[len(x)//2:]:
      print(len(x))
      exit()
else:
  s=s[:len(s)-1]
  l=len(s)
  for i in range(0,l+1,2):
    x=s[:l-i]
    if x[:len(x)//2] == x[len(x)//2:]:
      print(len(x))
      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:
s = input()

l = len(s)
ans = 0

for i in range(1 if l % 2 else 2, l, 2):
    t = s[:-i]
    tl = (l-i)//2

    if t[:tl] == t[tl:]:
        ans = tl*2
        break


print(ans)

Submission status: Accepted

Solution code:
import sys
S = input()[:-2]
while len(S) > 0:
    if S[:len(S) // 2] == S[len(S) // 2:]:
        print(len(S))
        sys.exit()
    S = S[:-2]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

n = -1
if len(s) % 2 == 0:
    n = -2
while len(s) > abs(n):
    hanbun = len(s[:n])//2
    if s[:hanbun] == s[hanbun:n]:
        print(len(s[:n]))
        break
    n -= 2

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_even_str(s):
    l = len(s)
    if l % 2 != 0:
        return False
    return s[:l // 2] == s[l // 2:]


S = input()[:-2]
while not is_even_str(S):
    S = S[:-2]
print(len(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()
while True:
  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 = list(input())
while s:
    s = s[:-1]
    sl = len(s)
    if sl%2 == 0:
        s1 = s[0:sl//2]
        s2 = s[sl//2:]
        if s1 == s2:
            print(sl)
            break

Submission status: Accepted

Solution code:
s = list(input())

ans = 0
while ans == 0:
    cnt = 0
    del s[-1], s[-1]
    for i in range(len(s)//2):
        if s[i] != s[i + len(s)//2]:
            break
        cnt += 1
    if cnt == len(s)//2:
        ans = len(s)

print(ans)

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:-i]):
        print(len(s)-i)
        break

Submission status: Accepted

Solution code:
def main():
    s = input()

    bool = False
    l = len(s)

    while bool == False:
        l = l - 2
        if s[0:l//2] == s[(l+1)//2:l]:
            bool = True

    print(l)

        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

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


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

Submission status: Accepted

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

if len(s)%2==1:
    s=s[:-1]
while len(s)>=0:
    l=len(s)//2
    if s[:l]==s[l:]:
        break
    s=s[:-1]
    s=s[:-1]
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def solve(S):
    for i in range(len(S)):
        S = S[:-1]
        if len(S) % 2 == 1:
            continue
        half = len(S) // 2
        if S[:half] == S[half:]:
            return len(S)

print(solve(S))

Submission status: Accepted

Solution code:
import sys

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

def solve():
    input = sys.stdin.readline
    S = list(input().strip("\n"))
    N = len(S)
    S.pop()
    for i in range(N):
        if doubleS(S):
            print(N - i - 1)
            break
        S.pop()
    else: print(0)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 0
i = 1
while i * 2 < len(S):
  l = S[:i]
  r = S[i:i*2]
  if(l == r):
    ans = i * 2
  i += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
s=s[:-2]
while s:
    n=len(s)//2
    p=s[:n]
    q=s[n:]
    if p==q:
        print(2*n)
        break
    else:
        s=s[:-2]

Submission status: Accepted

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

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

def main():
	s=input().rstrip().decode()

	n=len(s)

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













if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

index = len(S)-2

while index>0:
    half = index // 2
    if S[:half] == S[half:index]:
        break
    index -= 2

print(index)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
S = input()
lnS = len(S)
for i in range(lnS-1,-1,-1):
    #print(S)
    S = S[:i]
    flag = True
    if 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==0:
    n -= 1
    s = s[:-1]
while n%2!=0 or s[:n//2]!=s[n//2:]:
    n -= 1
    s = s[:-1]
print(n)

Submission status: Accepted

Solution code:
# coding: utf-8
# hello worldと表示する
# coding: utf-8
# hello worldと表示する
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

s=SI()
n=len(s)
for i in range(n-2,0,-2):
    u=s[:i]
    #print(u)
    if u[:i//2]==u[i//2:]:
        #print(u)
        print(i)
        sys.exit()
    #print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
length=len(s)
now_length=length-2
ans=0
while True:
    if s[0:int(now_length/2)]==s[int(now_length/2):now_length]:
        ans=now_length
        break
    else:
        now_length=now_length-2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

l = len(s) // 2 - 1
while True:
    t = 0
    for i in range(l):
        if s[i] == s[l + i]:
            t += 1
    if t == l:
        print(t * 2)
        exit(0)
    else:
        l -= 1

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

Submission status: Accepted

Solution code:
S=input()
# S="akasakaakasakasakaakas"

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

Submission status: Accepted

Solution code:
import sys
S = input()
while True:
    S = S[:-2]
    l = len(S)
    if S[:l // 2] == S[l // 2:]:
        print(l)
        sys.exit()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(500000)

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    S = input()
    N = len(S)//2
    for i in range(1, N+1):
        t = S[:2*N-2*i]
        n = len(t)//2
        if t[:n] == t[n:]:
            print(2*n)
            return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = open(0).read().rstrip()
 
if len(s)%2:
    s = s[:-1]
else:
    s = s[:-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)
n = n - 2 if n % 2 == 0 else n - 1
ans = -1
for i in range(n - 1, -1, -2):
    T = S[: i + 1]
    l = (i + 1) // 2
    if T[: l] == T[l:]:
        ans = i + 1
        break
print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

if len(s) == 2:
    print(1)
else:
    while len(s) > 2:
        s = s[:-2]
        n = len(s) // 2
        if s[:n] == s[n:]:
            print(len(s))
            exit(0)
    print(1)

Submission status: Accepted

Solution code:
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

def f(a,b):
    if a == b:
        return True
    return False
if __name__ == "__main__":
    s = L()
    for i in range(1,len(s)-1):
        a = s[:len(s)-i]
        n = len(a)
        #print(a[:n//2],a[n//2:])
        if (f(a[:n//2],a[n//2:])):
            print(n)
            break

Submission status: Accepted

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

S = list(str(input()))

while len(S) > 1:
    S.pop()
    if S[0 : len(S) // 2] == S[len(S) // 2 :] and len(S) % 2 == 0:
        print(len(S))
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = 0
n = len(s) // 2

for i in range(n-1):
    if s[0 : i] == s[i+1 : i+1 + i]:
        ans = i + 1

print(ans * 2)

Submission status: Accepted

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

Submission status: Accepted

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

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]

S=input()

if len(S)%2==1:
    S = S[:-1]
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        sys.exit()

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

Submission status: Accepted

Solution code:
S = list(input())
num = len(S)
for i in range(num):
    S.pop()
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        break

Submission status: Accepted

Solution code:
# ABC065_B
S = str(input())
N = len(S)

for i in range(1,N+1):
    T = S[0:-i]
    M = N-i
    if M % 2 == 1:
        pass
    elif T[0:(M//2)] != T[(M//2):M]:
        pass
    else:
        print(N-i)
        break

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

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

Submission status: Accepted

Solution code:
s=input()

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

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

Submission status: Accepted

Solution code:
A= list(input())
while True:
    A.pop()
    A.pop()
    B=len(A)//2
    if A[:B]==A[B:]:
        print(len(A))
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S = str(input())

if len(S) < 2 or len(S) > 200:
    sys.exit()
if not S.islower():
    sys.exit()

result = 0
for I in range(len(S)):
    length = len(S) - I
    if (not I == 0) and length % 2 == 0 and S[0:int(length / 2)] == S[int(length / 2):length]:
        print(length)
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    S = input()
    for i in range(len(S) - 2, 0, -2):
        if S[0:i // 2] == S[i // 2:i]:
            print(i)
            return


resolve()

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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-06-25 15:01:19 +0900
# LastModified: 2020-06-25 15:40:42 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    s = input()
    while s:
        s = s[:-1]
        if len(s)%2!=0:
            continue
        mid = len(s)//2
        left = s[:mid]
        right = s[mid:]
        if left==right:
            print(len(s))
            return

    


if __name__ == "__main__":
    main()

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
S = list(input())
for i in range(len(S)//2):
    flag =0
    _ = S.pop(-1)
    _ = S.pop(-1)
    bf = S[:len(S)//2]
    af = S[len(S)//2:]
    for i in range(len(bf)):
        if bf[i] != af[i]:
            flag = 1
            break
    if flag ==0:
        break
print(len(S))

Submission status: Accepted

Solution code:
S = input()

for i in range(1, len(S)):
    s = S[:-i]
    n = len(s)

    if n % 2 == 0 and s[:n // 2] == s[-n // 2:]:
        print(n)
        break

Submission status: Accepted

Solution code:
s=list(input())
from copy import copy
t=s.copy()

for i in range(len(t)):
  p=int(len(s)/2)
  if len(s)%2==0 and s[:p]==s[p:] and len(s)!=len(t):
    print(len(s))
    exit()
  else:
    s.pop(-1)

Submission status: Accepted

Solution code:
s=input()
f=False
sl=len(s)
while not f:
    sl-=2
    if s[0:sl//2]==s[(sl+1)//2:sl]:
        f=True
print(sl)