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) // 2, -1, -1):
    if s[:i] == s[i:2 * i]:
        print(2 * i)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
for i in range(2, N, 2):
    ans_str = S[:N - i]
    ans = len(ans_str)
    if ans_str[:ans // 2] == ans_str[ans // 2:]:
        print(ans)
        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 = list(input())
a = len(s)
for i in range(a):
    del(s[-1])
    if len(s) % 2 == 0:
        if s[:int(len(s)/2)] == s[int(len(s)/2):]:
            print(int(len(s)))
            break

Submission status: Accepted

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

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

Submission status: Accepted

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

S = list(input())
S.reverse()

for i in range(1, len(S)):
    s = S[i:]
    if len(s) % 2 == 1: continue
    x = len(s) // 2
    if s[:x] == s[x:]:
        print(len(s))
        exit()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
s  = input()
#  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

max_ = -1
for tail in range(2, len(s)):
    s_ = s[:tail]
    if len(s) % 2 == 0 and s_[:len(s_)//2] == s_[len(s_)//2:]: 
        max_ = max(max_, len(s_))

print(max_)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    le = len(S) - 1
    while le > 0:
        if len(S[:le]) % 2 == 0:
            mid = le // 2
            if S[:mid] == S[mid:le]:
                break
        le -= 1

    print(le)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import deque

S = input()
N = len(S) // 2
S = S[:N]
s1 = deque(S); s2 = deque(S)
ans = 2*N
for i in range(N-1):
  ans -= 2
  s = s1.pop()
  s2.appendleft(s)
  s2.pop(); s2.pop()
  if s1 == s2:
    print(ans)
    quit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, N//2):
    strs = S[:-2*i]
    if S[:(len(S)-2*i)//2] == S[(len(S)-2*i)//2:len(S)-2*i]:
        print(len(S)-2*i)
        break

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = list(str(input()))

del S[-1]

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

Submission status: Accepted

Solution code:
S = list(input())
s = S[0]
res = 0
for i in range(1,len(S)-1):
    s += S[i]
    n = len(s)
    middle = n//2
    if n%2 == 1:
        continue
    elif s[:middle] == s[middle:n]:
        res = n
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()

while True:
    S = S[:-2]
    half = len(S) // 2
    if S[:half] == S[half:]:
        ans = len(S)
        break

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

    half_length = int(len(s) / 2)
    if s[:half_length] == s[half_length:]:
        print(len(s))
        break

Submission status: Accepted

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

# In[16]:


S = input()


# In[19]:


length = len(S)
# if length%2 != 0:
#     S = S + "_"
for i in range(2,length,2):
    s = S[:-i]
#     print(i,s, S[:(length-i)//2]*2)
    if S[:(length-i)//2]*2 == s:
        print(len(s))
        break


# In[ ]:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

for i in range(1, len(S)-1):
    if judge_s(S[:-i]):
        ans = S[:-i]
        break

print(len(ans))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC066
# B
# ss

from collections import deque

s = deque(input())
ans = 0
while len(s) > 0:
    s.pop()
    s.pop()
    _ = list(s)
    _l = len(s)
    _f = _[:int(_l/2)]
    _b = _[int(_l/2):]
    if _f == _b:
        ans = _l
        break
        
print(ans)

Submission status: Accepted

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

for i in range(n-1 if(n%2==1) else n-2,0, -2):
    nx = i // 2
    #print("{} {}".format(s[0:nx],s[nx:i]))
    if (s[0:nx] == s[nx:i]):
        print(i)
        exit()
else:
    print(0)

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:
def main():
    S = input()
    S = S[:-1]

    N = len(S)

    dp = [[0] * (N + 1) for _ in range(N + 1)]
    for i in range(N):
        for j in range(N):
            if S[i] == S[j]:
                dp[i + 1][j + 1] = min(
                    dp[i][j] + 1,
                    max(0, j - i)
                )

    ans = 0
    for i in range(N):
        if i * 2 < N and dp[i][i * 2] == i:
            ans = max(ans, i * 2)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
s = input()
cnt = 0
ans = 0
ss = ''
for i in range(len(s)):
    if len(s[:-(i+1)]) % 2 == 0:
        ss = s[:-(i+1)]
        # print(ss)
        cnt = 0
        for j in range(int(len(ss)/2)):
            # print(ss[j])
            # print(ss[j+int(len(ss)/2)])
            if ss[j] == ss[j+int(len(ss)/2)]:
                cnt += 1
        if cnt == int(len(ss)/2):
            ans = max(ans, cnt)
print(ans*2)
# n = int(input())
# v = readints()
# print(set(v))
# if len(set(v)) == 1:
#    print(len(v)//2)
#    exit()

Submission status: Accepted

Solution code:
# s+s になる文字列を末尾を削ることで作る。
# 長さが限られているのでループを回す
s = input()
l = len(s)
for i in range(l // 2 - 1, 0, -1):
    if s[:i] == s[i : 2 * i]:
        print(2 * i)
        exit()

Submission status: Accepted

Solution code:
s = list(input())
s.reverse()
ans = 0
for i in range(len(s)):
  if len(s)%2 == 1:
    ans += 1
    del s[0]
  else:
 
    if s[:len(s)//2] == s[len(s)//2:]:
      if ans != 0:
        print(len(s))
        break
      else:
        ans += 1
        del s[0]
    else:
      ans += 1
      del s[0]

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

S = input()


def is_valid(s):
    if len(s) & 1:
        return False
    return s == (s[:len(s) // 2]) * 2


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
S = str(input())
S=S[0:len(S)-1]

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

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

S = list(input())

N = len(S) - 1
N //= 2

for i in range(N, 0, -1):
    if S[:i] == S[i: 2 * i]:
        print (2 * i)
        break

Submission status: Accepted

Solution code:
def resolve():
  s = input()
  l = (len(s) - 2) // 2
  while (l > 0):
    if s[0:l] == s[l:2*l]:
      print(2*l)
      return
    l -= 1

  print(2*l)

  return

if __name__ == "__main__":
  resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    s = list(input())

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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())
s=list(s)
while True:
  del s[len(s)-1]
  if len(s)%2==0:
    count=0
    for i in range(0,int(len(s)/2)):
      if s[i]==s[i+int(len(s)/2)]:
        count=count+1
    if count==int(len(s)/2):
      print(len(s))
      break

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
ans = 0

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

Submission status: Accepted

Solution code:
s = input()
ans = 0

for i in range(1, len(s) - 1):
    u = s[:-i]
    p = len(u)//2
    if u[:p] == u[p:]:
        ans = max(ans, len(u))

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed May 13 13:33:54 2020

@author: shinba
"""

s = input()

for i in range(len(s)-2,1,-2):
    if s[:i] == s[:int(i/2)]*2:
        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 = list(input())
N = len(S) >> 1
while S:
    S.pop()
    S.pop()
    N -= 1
    if S[0:N] == S[N:N << 1]:
        print(N << 1)
        break

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
s = s[:-1]
n = int(len(s)/2)

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    for i in range(1, len(s)):
        r = s[:-i]
        q = len(s[:-i])
        if q % 2 != 0:
            continue
        if r[:q//2] == r[q//2:]:
            ans = q
            break
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys


def main():
    S = sys.stdin.readline().rstrip()

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

    while S:
        if S[: len(S) // 2] == S[len(S) // 2 :]:
            break
        else:
            S = S[:-2]

    print(len(S))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
S = input()
for i in range(len(S)):
    S = S[:-1]
    if len(S) % 2 == 0:
        t = len(S) // 2
        if S[:t] == S[t:]:
            print(len(S))
            exit()

Submission status: Accepted

Solution code:
s = input()
def check(str):
    a1 = str[:len(str)//2]
    a2 = str[len(str)//2:]
    return 1 if a1==a2 else 0
ls = len(s)
for i in range(2,ls,2):
    str = s[:ls-i]
    if check(str):
        print(len(str))
        break

Submission status: Accepted

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

while len(S) >= 2:
    i = len(S) // 2
    if S[:i] == S[i:]:
        print(len(S))
        break

    S = S[:-2]

Submission status: Accepted

Solution code:
S = input()

N = len(S)

import sys

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

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

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    S = input().rstrip()

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
t = s[:len(s)//2]

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

Submission status: Accepted

Solution code:
def main():
	S = input()
	ans = 0
	while(len(S) > 0):
		l = len(S) - 1
		S = S[0:l]

		if(l%2 == 0):
			left = S[0:l//2]
			right = S[l//2:]

			if(left == right):
				ans = l
				break

	print(ans)

if __name__ == "__main__":
	main()

Submission status: Accepted

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

while True:
    ls = len(s)
    # print(f"{s[:ls // 2]:} == {s[-ls // 2:]:}")
    if s[:ls // 2] == s[-ls // 2:]:
        print(len(s))
        break
    s = s[:-2]

Submission status: Accepted

Solution code:
import sys
def S(): return sys.stdin.readline().rstrip()
S = S()
while 1:
    S = S[:-2]
    l = len(S)
    if S[:l//2]==S[l//2:]:
        print(l)
        break

Submission status: Accepted

Solution code:
S = input()
int_list = []
for i in range(len(S)):
    sub_S = S[:i]
    if len(sub_S) % 2 !=0:
        continue
    if sub_S[:int(len(sub_S) / 2)] == sub_S[int(len(sub_S) / 2):]:
        int_list.append(len(sub_S))
print(max(int_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
x=1#特に意味はない
while x>0:
    S=S[:-2]
    if S[:len(S)//2]==S[len(S)//2:]:
        print(len(S))
        break

Submission status: Accepted

Solution code:
s = input()

ans = ((len(s)-1)//2)*2

while True:
  if s[0:ans//2] == s[ans//2:ans]:
    break
  ans -= 2

print(ans)

Submission status: Accepted

Solution code:
s=input()
n = len(s)
s = s[0:n-1]
if(len(s)%2==1):s=s[0:len(s)-1]
tmp = len(s)//2
while(1):
    f=True
    for i in range(tmp):
        if s[i]==s[tmp+(i)]:
            continue
        else:
            s = s[0:len(s)-2]
            f=False
            tmp-=1
            break
    if f:break

print(tmp*2)

Submission status: Accepted

Solution code:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
# endregion
S = rs()[:-1]
while S[:len(S)//2] != S[len(S)//2:]:
    S = S[:-1]
print(len(S))

Submission status: Accepted

Solution code:
S=input()

for i in range(1,len(S)):
    if (len(S)-i)%2 == 0 and 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:
def check(s):
    if len(s)%2 == 1:
        return False
    if s[len(s)//2:] == s[:len(s)//2]:
        return True
    else:
        return False
 
S = input()
 
for i in reversed(range(1,len(S))):
    if check(S[:i]):
        print(i)
        break

Submission status: Accepted

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

S = input()

for i in reversed(range(1,len(S))):
    if check(S[:i]):
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
lenS = len(S)
for _ in range(lenS):
    S.pop()
    if len(S)%2 == 0:
        tmp = len(S)//2
        if S[:tmp] == S[tmp:]:
            ans = len(S)
            print(ans)
            break

Submission status: Accepted

Solution code:
s = input()

s_len = len(s)

for i in range(1, int(s_len/2)+1):
    s = s[:-2]
    half = int(len(s)/2)
    s_mae = s[:half]
    s_ato = s[half:]
    if s_mae == s_ato:
        break

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

if n % 2 == 1:
    n -= 1

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

Submission status: Accepted

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

Submission status: Accepted

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

if n % 2 == 1:
    n -= 1

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

Submission status: Accepted

Solution code:
S=input()

i=1
while i<len(S):
    ans=len(S[:-i])
    if ans%2==0:
        if S[:-i][:ans//2]==S[:-i][ans//2:]:
            print(ans)
            break
    i+=1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
ans=""
for i in range(2,N,2):
    T=S[:i]
    T1=T[:i//2]
    T2=T[i//2:]
    if T1==T2:
        ans=T
print(len(ans))

Submission status: Accepted

Solution code:
from sys import exit

s = input()
n=len(s)
cnt=1
while cnt <= n:
    if (n-cnt)%2==0:
        if s[0:(n-cnt)//2-1] == s[(n-cnt)//2:n-cnt-1]:
            print(n-cnt)
            exit()
        else:
            cnt +=1
    else:
        cnt += 1

Submission status: Accepted

Solution code:
from collections import Counter
s = input()
ans=0

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