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: Wrong Answer

Solution code:
a = list(input())
a = a[:-1]
flag = True

while(flag):
    b = set(a)
    flag = False
    for i in b:
        if a.count(i)%2!=0 :
            a = a[:-1]
            flag = True
            break

print(len(a))

Submission status: Wrong Answer

Solution code:
#s = list(input())
s = input()
n = len(s)
count = 0   #消した数

if n % 2 == 1:
    count += 1

while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2

if count == 0:
    count = int(n/2)

print(n-count)

Submission status: Wrong Answer

Solution code:
def hantei(list_str,n):
    k = int(n/2)
    if list_str[0:k] == list_str[k:n]:
        return n
    else:
        return 0
S = list(input())
length = len(S)
flag = 0
if length == 2:
    print(0)
    flag = 1
elif length == 3:
    length -= 1
    ans = hantei(S,2)
    print(ans)
    flag = 1
elif length % 2 == 1:
    length -= 1
    ans = 0
else:
    length -= 2
    ans = 0
while length < 2:
        ans = hantei(S,length)
        if ans != 0:
            break
        length -= 2

if flag == 0:
    if ans == 0:
        print(1)
    else:
        print(ans)

Submission status: Wrong Answer

Solution code:
def hantei(list_str,n):
    k = int(n/2)
    if list_str[0:k] == list_str[k:n]:
        return n
    else:
        return 0
S = list(input())
length = len(S)
flag = 0
if length == 2:
    print(0)
    flag = 1
elif length == 3:
    length -= 1
    ans = hantei(S,2)
    print(ans)
    flag = 1
elif length % 2 == 1:
    length -= 1
    ans = 0
else:
    length -= 2
    ans = 0
while length != 2:
        ans = hantei(S,length)
        if ans != 0:
            break
        length -= 2

if flag == 0:
    if ans == 0:
        print(1)
    else:
        print(ans)

Submission status: Wrong Answer

Solution code:
def hantei(list_str,n):
    k = int(n/2)
    if list_str[0:k] == list_str[k:n]:
        return n
    else:
        return 0
S = list(input())
length = len(S)
flag = 0
if length == 2:
    print(0)
    flag = 1
elif length == 3:
    length -= 1
    ans = hantei(S,2)
    print(hantei)
    flag = 1
elif length % 2 == 1:
    length -= 1
    ans = 0
else:
    length -= 2
    ans = 0
while length != 2:
        ans = hantei(S,length)
        if ans != 0:
            break
        length -= 2

if flag == 0:
    if ans == 0:
        print(1)
    else:
        print(ans)

Submission status: Wrong Answer

Solution code:
c=0
i=0
list1=[]
list2=[]


S = input('')
char_list = list(S)
c = len (char_list)
c= c-1
#print(c)

while c>1:
	if c % 2 == 0:
		d=int(c/2)
		#print (d)
		for i in range(d):
			list1.append(char_list[i]) 
			list2.append(char_list[i+d])
		#print (list1)
		#print(list2)

		if list1 == list2:
			print (len (list1))
			break

		list1=[]
		list2=[]
	c=c-1

Submission status: Wrong Answer

Solution code:
s = input()

n = int(len(s))

target = []
n_list = []

for i in range(1, n):
    if i%2 == 0:
        target.append(s[:i])


for t in target:
    t_n = len(t)
    for i in range(1, int(t_n/2)+1):
        if t_n%i == 0:
            flag = 0
            tmp_s = t[:i]
            tmp_n = int(t_n/i)
            for j in range(1, tmp_n):
                if t[j*i:(j+1)*i] != tmp_s:
                    flag = 1
                    break
            if flag == 0:
                n_list.append(t_n)
                break

print(max(n_list))

Submission status: Wrong Answer

Solution code:
c=0
i=0
list1=[]
list2=[]


S = input('')
char_list = list(S)
c = len (char_list)
c= c-1
print(c)

while c>1:
	if c % 2 == 0:
		d=int(c/2)
		print (d)
		for i in range(d):
			list1.append(char_list[i]) 
			list2.append(char_list[i+d])
		print (list1)
		print(list2)

		if list1 == list2:
			print (len (list1))
			break

		list1=[]
		list2=[]
	c=c-1

Submission status: Wrong Answer

Solution code:
#s = list(input())
s = input()
n = len(s)
count = 0   #消した数

if n % 2 == 1:
    count += 1

while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2

print(n-count)

Submission status: Wrong Answer

Solution code:
def hantei(list_str,n):
    k = int(n/2)
    if list_str[0:k] == list_str[k:n]:
        return n
    else:
        return 0
S = list(input())
length = len(S)
if length == 2:
    ans = hantei(S,2)
elif length == 3:
    length -= 1
    ans = hantei(S,2)
    ans = 0
elif length % 2 == 1:
    length -= 1
    ans = 0
else:
    length -= 2
    ans = 0
while length != 2:
        ans = hantei(S,length)
        if ans != 0:
            break
        length -= 2

if ans == 0 :
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
#s = list(input())
s = input()
n = len(s)
count = 0   #消した数

if n % 2 == 1:
    count += 1

while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2

print(count)

Submission status: Wrong Answer

Solution code:
a = list(input())
a = a[:-1]
flag = True

while(flag):
    b = set(a)
    for i in b:
        if a.count(i)%2!=0 :
            a = a[:-1]
            break
        flag = False

print(len(a))

Submission status: Wrong Answer

Solution code:
S = list(input())
length = len(S)
if length == 2:
    ans = 0
elif length == 3:
    length -= 1
    ans = 0
elif length % 2 == 1:
    length -= 1
    ans = 0
else:
    length -= 2
    ans = 0

def hantei(list_str,n):
    k = int(n/2)
    if list_str[0:k] == list_str[k:n]:
        return n
    else:
        return 0

while length != 2:
        ans = hantei(S,length)
        if ans != 0:
            break
        length -= 2

if ans == 0 :
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
check = True
i=0
while check:
    check = False
    for x in range(0,i+1):
        if s[x]!=s[x+i+1]:
            check = True
    i=i+1

print(i*2)

Submission status: Wrong Answer

Solution code:
s = raw_input()
s = s[:len(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)
            exit
    s = s[:len(s)-1]

Submission status: Wrong Answer

Solution code:
s = input()
check = True
i=0
while check:
    for x in range(0,i+1):
        check = False
        if s[x]!=s[x+i+1]:
            check = True
    i=i+1

print(i*2)

Submission status: Wrong Answer

Solution code:
char = input()
char = char[0:-1]
print(char)
while(1):
    #print(char[:(len(char)//2)]+" "+char[len(char)//2:])
    if char[:(len(char)//2)] == char[len(char)//2:]:
        break
    else :
        char = char[0:-1]
print(len(char))

Submission status: Wrong Answer

Solution code:
s = input()
if len(s)%2 != 0:
 del s[-1]
a = "".join(s[:int(len(s)/2)+1])
b = "".join(s[int(len(s)/2):])
for i in range(len(s)):
 if len(s)%2 != 0:
  del s[-1]
  a = "".join(s[:int(len(s)/2)+1])
  b = "".join(s[int(len(s)/2):])
 elif a == b:
  break
print(int(len(s)/2))

Submission status: Wrong Answer

Solution code:
def check(s):
    if len(s)%2 !=0:
        return False
    i=int(len(s)/2)
    s1=s[:i]
    s2=s[i:]
    print(s1+" "+s2)
    return s1==s2

s = input()
while True:
    s = s[:len(s)-1]
    if check(s):
        print(len(s))
        break

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

ss = raw_input()

while(True):
  ss = ss[:-1]
  leng = len(ss)
  former = ss[:leng/2]
  later  = ss[leng/2:]

  print(former, later)
  if former == later:
    leng = len(former) + len(later)
    break

print(leng)

Submission status: Wrong Answer

Solution code:
from collections import deque
def main():
    s=deque(input())
    for i in range(0,len(s)):
        s.pop()
        print(s)
        if len(s)%2==1:
            continue
        else:
            if "".join(s)[0:len(s)//2]=="".join(s)[len(s)//2:len(s)]:
                print(len(s))
                break;
if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:

def main():
    msg = input()
    msg = msg[:-1]
    if len(msg) % 2 != 0:
        msg = msg[:-1]
    while len(msg) >= 2:
        before = msg[:int(len(msg) / 2)]
        after = msg[int(len(msg) / 2):]
        if before == after:
            print(len(before))
            break
        msg = msg[:-2]


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def main():
    msg = input()
    while len(msg) >= 2:
        before = msg[:int(len(msg) / 2)]
        after = msg[int(len(msg) / 2):]
        if before == after:
            print(len(before))
            break
        msg = msg[:-1]


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import numpy as np

if __name__=="__main__":
    s = input().replace("\n", "")
    ss = ""
    for i in range(2,len(s),2):
        ss = s[0:i]
        if ss[0:int(i/2)] == ss[int(i/2):i]:
            print(len(ss))
            break

Submission status: Wrong Answer

Solution code:
s = input()
check = True
i=0
while check:
    for x in range(0,i):
        if s[x]==s[(x+1)*2-1]:
            check = False
        else:
            check = True
    i=+1
print(i*2)

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    s2 = s[:-1-i]
    flag = True
    for j in range(len(s2)):
        if s[j] != s2[-1-j]:
            flag = False
            break
    if flag:
        print(len(s2))
        break

Submission status: Wrong Answer

Solution code:
s = input()[:-1]
l = 0
f = []
i = 0
for w in list(s):
    i += 1
    if w in f:
        f.remove(w)
    else:
        f.append(w)
    if len(f) == 0:
        l = i
print(l)

Submission status: Wrong Answer

Solution code:
S=raw_input()

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

if len(S)==2:
    print 1

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s=list(raw_input())
while len(s) > 1:
    s.pop()
    left="".join(s[:len(s)/2])
    right="".join(s[len(s)/2:])
    if left == right:
        print len(left+right)

Submission status: Wrong Answer

Solution code:
S=raw_input()

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

Submission status: Time Limit Exceeded

Solution code:
a = [list(map(str,input().split()))]
while True:
  h = int(len(a)/2)
  for i in range(h-1):
    if a[i] !=a[i+h]:
      break
    elif all(a[i]==a[i+h]):
      print(len(a))
      exit()
  a[:-1]

Submission status: Time Limit Exceeded

Solution code:
a = [list(map(str,input().split()))]
while True:
  h = int(len(a)/2)
  for i in range(h-1):
    if all(a[i]==a[i+h]):
      print(len(a))
      exit()
  a[:-1]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
S = input()

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

#残り文字数
lest = len(S)

while 1:
  if lest % 2 == 1: continue
  if S[:lest//2]==S[lest//2:]:
    print(lest)
    exit()
  else:
    lest -= 2
    S = S[:lest]

Submission status: Time Limit Exceeded

Solution code:
s = input()
mmax = 0
def function(string):
  global mmax
  n = len(string)
  if n<2:
    return
  if n%2==0:
    if string[0:int(n/2)]==string[int(n/2):n]:
      mmax = max(mmax, n)
  function(string[0:n-1])
  function(string[1:n])
function(s[0:len(s)-1])
function(s[1:len(s)])
print(mmax)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
s = input()
check = True
i=0
while check:
    for x in range(0,i):
        if s[x]==s[(x+1)*2-1]:
            check = False
        else:
            check = True
print((i+1)*2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = str(input())
ans = 0

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

    if s[0:i//2] == s[i//2:i] and i > ans :
        ans = i
    elif i <= ans:
        break

if len(s)==2:
    ans = 2
print(ans)

Submission status: Accepted

Solution code:
S = input()

l = len(S)

l = (l-2)//2
while l > 0:
    if S[0:l] == S[l:2*l]:
        print(2*l)
        break
    l = l-1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def answer(s: str) -> int:
    if len(s) % 2 == 1:
        s += ' '

    for _ in range(len(s) // 2):
        s = s[:-2]
        l = len(s)
        middle = l // 2

        if s[:middle] == s[middle:]:
            return l


def main():
    s = input()
    print(answer(s))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()

for i in range(1, len(S)):
  s=S[0:len(S)-i]
  #print(s)
  if len(s)%2==1:
    continue
  #print('pre', s[0:int(len(s)/2)+1])
  #print('follow', s[int(len(s)/2):len(s)])
  if s[0:int(len(s)/2)]==s[int(len(s)/2):len(s)]:
    print(len(S)-i)
    break

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = n

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

    if s[0:ans//2] == s[ans//2:]:
        break

print(ans)

Submission status: Accepted

Solution code:
def input_int():
    return(int(input()))

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

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

def run():
    S = list(input())

    S = S[:len(S) - 1]

    for target_len in range(len(S) - 1, 1, -1):
        if target_len % 2 == 0:
            mid = target_len // 2
            first = S[:mid]
            second = S[mid:mid + mid]

            if first == second:
                print(target_len)
                return

run()

Submission status: Accepted

Solution code:
s = input()

length = 0
if len(s) % 2 == 0:
  length = len(s) // 2 - 1
else:
  length = len(s) // 2

top = -1

for i in range(length):
  flag = True
  for j in range(i):
    if s[j] != s[i + j + 1]:
      flag = False
  if flag :
    top = (i+1) * 2

print(top)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge(Str, Len):
  if Str[:Len//2] == Str[Len//2:]:
    return True
  else:
    return False

S = input()
L = len(S)
i = 2 - (L % 2)
S = S[:-i]
L -= i
if judge(S, L):
  print(L)
else:
  while not judge(S, L):
    S = S[:-2]
    L -= 2
  print(L)

Submission status: Accepted

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

Submission status: Accepted

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

ans = []

for i in range(len(s)):
  tmp = s[0:len(s)-(i+1)]
  #print(tmp[0:int(len(tmp)/2)],tmp[int(len(tmp)/2):len(tmp)])
  if tmp[0:int(len(tmp)/2)] == tmp[int(len(tmp)/2):len(tmp)] and len(tmp)%2 == 0:
    ans.append(len(tmp))
    
print(max(ans))

Submission status: Accepted

Solution code:
import sys
S = input()

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

Submission status: Accepted

Solution code:
#!/usr/local/bin/python3
# https://atcoder.jp/contests/abc066/tasks/abc066_b

S = list(input())[:-2]

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

def judge(S):
   if (len(S) % 2 == 0) and (S[:len(S) // 2] == S[(-1) * len(S) // 2:]):
      return True
   else:
      return False

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

Submission status: Accepted

Solution code:
# B - ss
def main():
    s = list(input())

    for _ in range(len(s)):
        s.pop()
        if len(s) % 2 == 0:
            p = len(s)//2
            if s[0:p] == s[p:]:
                print(len(s))
                exit()


if __name__ ==  "__main__":
    main()

Submission status: Accepted

Solution code:
S = str(input())
for i in range(1, int(len(S) / 2)):
    T = S[0: len(S) - 2 * i]
    clear = 0
    m = int(len(T) / 2)
    for j in range(m):
        if T[j] == T[m + j]:
            clear += 1
    if clear == m:
        print(len(T))
        break

Submission status: Accepted

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

s = input().strip()

if len(s) == 2:
    print(0)
    sys.exit(0)

for i in range(1, len(s) // 2 + 1):
    split_index = (len(s) - i * 2) // 2
    if s[:split_index] == s[split_index:len(s) - i * 2]:
        print(len(s) - i * 2)
        sys.exit(0)

Submission status: Accepted

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


import sys
for i in range(len(S)):
    del S[-1]
    for j in range(len(S)):
        if len(S)%2==0:
            if S[0:len(S)//2]==S[len(S)//2:len(S)]:
                print(len(S))
                sys.exit()
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

for i in range(2, len(S)):
    miniS = S[0:-i]
    if len(miniS) % 2 == 0:
        front = ''.join(miniS[0:len(miniS)//2])
        back = ''.join(miniS[len(miniS)//2:len(miniS)])
        if front == back:
            print(len(miniS))
            exit()

Submission status: Accepted

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

S=input().strip()

N = len(S)//2
i = 0
while True:
    i += 1
    a = S[0:(N-i)]
    b = S[(N-i):(2*N-2*i)]
    if a == b:
        print(len(a)*2)
        exit()

Submission status: Accepted

Solution code:
def f():
    s = list(input())
    for i in range(len(s)):
        s.pop(-1)
        s.pop(-1)
        c = 0
        for j in range(len(s)//2):
            if s[j] == s[len(s)//2 + j]:
                c += 1
                if c == len(s)//2:
                    return len(s)
            else:
                break
print(f())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

while True:
    l = len(s)
    s = s[:l - 1]
    if len(s) % 2 != 0:
        pass
    else:
        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)):
    ss = s[:-2-i]
    size = len(ss)
    if size%2==0 and ss[:size//2] == ss[size//2:]:
        print(size)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import copy
import math
import itertools
import numpy as np
S=input()
for i in range(1,len(S)):
    l = len(S[0:len(S)-i]) 
    if l%2==0:
        if S[0:len(S)-i] == S[0:int(l/2)]+S[0:int(l/2)]:
            print(l)
            sys.exit(0)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

s = s[:len(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))
      exit()
  s.pop(-1)

Submission status: Accepted

Solution code:
class mystr:
    def __init__(self,string):
        self.value = string

    def isEven(self):
        l = len(self.value)
        if (not l & 1) and self.value[:l//2] == self.value[l//2:]:
            return True
        else:
            return False

    def pop(self):
        l = len(self.value)
        self.value = self.value[:l-1]

s = mystr(input())
l = len(s.value)
for i in reversed(range(l)):
    s.pop()
    if s.isEven():
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

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:
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:
s = input()

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

while len(s) >= 2:
    half = len(s) // 2
    if s[:half] == s[half:]:
        print(len(s))
        break
    s = s[2:]

Submission status: Accepted

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

Submission status: Accepted

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

if N%2 == 1:
    M = N-1
else:
    M = N-2

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush

sys.setrecursionlimit(10**6)
INF = 10**20

def mint():
    return map(int,input().split())
def lint():
    return map(int,input().split())
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input().strip()
while len(S) > 0:
  S = S[:-1]
  mid = len(S)//2
  if S[:mid] == S[mid:]:
    print(len(S))
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())

while True:
    N = N[0:-1]
    if len(N) % 2 == 0:
        if N[0:int(len(N)/2)] == N[int(len(N)/2):]:
            break

print(len(N))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ls = len(S)

while True:
    ls -= 1
    if ls % 2 == 1:
        continue
    leftS = S[0:ls//2]
    rightS = S[ls//2:ls]
    if leftS == rightS:
        print(ls)
        exit()

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    l = len(S)

    while True:
        l -= 2
        first = S[:l // 2]
        second = S[l // 2: l]
        if first == second:
            return print(l)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = str(input())
S = S[:-2]

for _ in range(len(S)//2):
  
  if S[:len(S)//2] == S[len(S)//2:]:
    print(len(S))
    break

  else:
    S = S[:-2]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

odd = len(S) % 2
little = odd + (1-odd)*2
start = len(S)-1-little

ans = 0
for i in range(start,0,-2):
  half = (i+1)//2
  a = S[:half]
  b = S[half:half*2]
  if a == b:
    #print(a,b)
    ans = len(a)*2
    break
    
    
print(ans)

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))
            exit()
    elif len(s)==1:
        print(1)
        exit()

Submission status: Accepted

Solution code:
s = str(input())


#print(kind)
for i in range(2, len(s), 2):
    line = s[:len(s)-i]
    #print(line)
    if line[:len(line)//2] == line[len(line)//2:]:
        ans = len(line)    
        break


print(ans)

Submission status: Accepted

Solution code:
S = input()
test = ""
tmp = 0
for i in range(1, len(S)):
    j = -1 * i
    test = S[:j]
    tmp = len(test) // 2
    if len(test) % 2 == 0 and test[0:tmp] == test[tmp:]:
        print(len(test))
        exit()

Submission status: Accepted

Solution code:
S: str = input()

for i in range(len(S)-2, 0, -2):
    words: str = S[:i]
    half: int = len(words)//2

    if words[:half] == words[half:]:
        print(half * 2)
        break

Submission status: Accepted

Solution code:
S = input()

for i in range(1, len(S)):
    gumozi = S[0:len(S)-i]

    if gumozi[0:len(gumozi)//2] == gumozi[(len(gumozi)//2):len(gumozi)]:
        print(len(gumozi))
        exit()
print(0)