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:
st=input()
num=len(st)
for x in range(1,num+1):
    st = list(st)
    del st[-1:]
    st = "".join(st)
    n=len(st)
    if n%2==0:
        p=int(n/2)
        st1=st[:p]
        st2=st[-p:]
        if st1==st2:
            print(len(st))
            break
        else:
            continue
    else:
        continue

Submission status: Accepted

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

import sys
import subprocess
import json
import time
import math
import re
import sqlite3

def ok(S):
    if len(S) % 2 != 0: return False
    for i in range(len(S) // 2):
        if S[i] != S[len(S) // 2 + i]: return False
    return True

S = input()
for i in range(1, len(S)):
    if ok(S[:-i]):
        print(S[:-i], file=sys.stderr)
        print(len(S[:-i]))
        break

Submission status: Accepted

Solution code:
S = raw_input()
flag = 0
S = S[:-1]
while(len(S) > 0):
  if len(S) % 2 == 1:
     S = S[:-1]
  else:
     a = S[:len(S)/2]
     b = S[len(S)/2:]
     if a == b:
        ans = S
        break
     S = S[:-1]
print len(S)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def find_even(text):
    chars = list(text)
    tail_index = (len(chars) + 1) // 2
    pre = 0
    while tail_index > 0:
        tail_index -= 1
        pre = 0
        post = tail_index
        while chars[pre] == chars[post]:
            pre += 1
            post += 1
            if pre == tail_index:
                return 2 * tail_index
    raise("Error")

if __name__ == "__main__":
    # run_test(find_even, test_pair)
    print(find_even(raw_input()))

Submission status: Accepted

Solution code:
def solve(s):
    L = len(s)
    L -= 1
    if L % 2 == 1:
        L -= 1
    while L >= 2:
        if s[:L/2] == s[L/2:L]:
            return L
        L -= 2
    return 0


def main():
    s = raw_input().rstrip()
    print solve(s)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
data=list(map(str,input()))
del data[-1]
while len(data):
    m = len(data)//2
    if data[:m]==data[m:]:
        print(len(data))
        break
    del data[-1]
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = raw_input()
n = len(S)

ans = 0
for k in range((n+1)/2):
    if S[:k] == S[k:2*k]:
        ans = k * 2
print ans

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    s = S()
    e = set()
    r = len(s)
    for i in range(r-2,-1,-2):
        if s[:i//2] == s[i//2:i]:
            return i
    return -1


print(main())

Submission status: Accepted

Solution code:
s = input()

length = len(s) - 2

def guumoji(s):
    length = len(s)

    if s[:length//2] == s[length//2:]:
        return True

    return False

while length > 0:
    if guumoji(s[:length]):
        break

    length -= 2

print(length)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC066B

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string = input()

if len(string)%2==0 :
    string = string[:-2]
else :
    string = string[:-3]
length = len(string)

while length>0 :
    if string[:length//2]==string[length//2:] :
        print(length)
        break
    length -= 2
    string = string[:-2]

Submission status: Accepted

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

Submission status: Accepted

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


length = len(S)


while S[:int(length / 2)] != S[int(length / 2):]:
      S = S[:-2]
      length = len(S)

      if length == 0:
          breaek

print(length)

Submission status: Accepted

Solution code:
def isEvenstring(s):
	l = len(s)
	center = int(l/2)
	if l%2 == 0:
		return s[:center]==s[center:]

	else:
		return False




if __name__ == '__main__':
	string = input()
	l = len(string)
	for i in range(1, l):
		if isEvenstring(string[:-i]):
			print (l - i)
			break

Submission status: Accepted

Solution code:
s = input()

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

    ok = True
    for i in range(L//2):
        if s[i] != s[L//2+i]:
            ok = False
    if ok:
        break

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

i=0
L=[]

for i in range(len(s)):
    
    
    if s[0:i]==s[i:(2*i)]:
        L.append(2*i)
    
print(max(L))

Submission status: Accepted

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

#-------
# Initialize
S = str(input())[:-1]

#-------
# Define
def check(s):
    if len(s) % 2 == 1:
        return False
    if (s[:int(len(s)/2)] == s[int(len(s)/2):]):
        return True
    else:
        return False

#-------
# Do
while (len(S) > 0):
    if check(S):
        print(len(S))
        break
    else:
        S = S[:-1]


#-------
# Output

Submission status: Accepted

Solution code:
from sys import stdin
s = stdin.readline().strip()
n = len(s)
n-=2
while True:
 if s[:n/2]== s[n/2:n]:
  break
 n-=2
print n

Submission status: Accepted

Solution code:
print(len(__import__("re").search(r"(.+)\1", input()[:-1]).group(0)))

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
    s = s[:-1]
    if len(s) % 2 == 1:
        continue
    ss = s[len(s)//2:]
    flag = True
    for j in range(len(ss)):
        if ss[j] != s[j]:
            flag = False
            break
    if flag:
        print(len(s))
        break
    s = s[:-1]

Submission status: Accepted

Solution code:
a = list(input())
flag = True

a = a[:-1]
while(flag):
    flag = False
    if len(a)%2!=0:
        a = a[:-1]
        flag = True
        continue
    if a[0:len(a)//2]!=a[len(a)//2:]:
            a = a[:-1]
            flag = True



print(len(a))

Submission status: Accepted

Solution code:
# coding: utf-8

import numpy as np

if __name__=="__main__":
    s = input().replace("\n", "")
    n = len(s)
    ss = ""
    if n%2 == 1:
        s = s[0:n-1]
        n = len(s)
    elif n%2 == 0:
        s = s[0:n-2]
        n = len(s)

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

Submission status: Accepted

Solution code:
S = input()

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

flag = 0
while flag == 0:
    S = S[:-2]
    ans = int(len(S) / 2)
    same_char = 0
    i = 0
    while i < ans:
        if S[i] == S[ans + i]:
            same_char += 1
        else:
            break
        i += 1
    if ans == same_char:
        flag = 1

print(len(S))

Submission status: Accepted

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: Accepted

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)*2)
			break

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
s=input()

n=len(s)

def isok(s):
    n=len(s)
    if n%2==0:
        m=int(n/2)
        if s[0:m]==s[m:n]: return True
    return False

for i in range(n-1,0,-1):
    s=s[0:i]
    if isok(s): print(i) ; break

Submission status: Accepted

Solution code:
string = list(input())
string.pop()
string.pop()
while "".join(string[:len(string) // 2]) != "".join(string[len(string) // 2:]):
	#print("".join(string[:len(string) // 2]), "".join(string[len(string) // 2:]))
	string.pop()
	string.pop()
# print("".join(string[:len(string) // 2]), "".join(string[len(string) // 2:]))
print(len(string))

Submission status: Accepted

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

#print (ss)
for i in range(len(ss)):
    chrnum = int(len(ss))- i
    #print (chrnum)
    if chrnum % 2 == 0:
        #print (ss[0:int(chrnum/2)], end=' ')
        #print (ss[int(chrnum/2) : chrnum])
        if ss[0:int(chrnum/2)] == ss[int(chrnum/2) : chrnum]:
            print (chrnum)
            exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:


a=input()
num=len(a)

num=num-2


for i in range(num,0,-1):
    a=a[:i]
    nums=int(i/2)
    s=a[:nums]
    if str(s)*2==str(a):
        print(len(a))
        break

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while True:
  S.pop()

  if len(S) % 2 != 0:
    continue

  if S[:len(S) // 2] * 2 == S:
    break

print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
T = list(S)
flag = 0

while flag == 0:
	del T[len(T)-1]
	del T[len(T)-1]
	if T[0:len(T)//2] == T[len(T)//2:len(T)]:
		flag = 1
		print(len(T))

Submission status: Accepted

Solution code:
s = input()

l = len(s)

for _ in range(200):
	s = s[:l-2]
	l = l - 2
	if s[:l//2] == s[l//2:]:
		print(l)
		break
	else:
		pass
else:
	print('no match')

Submission status: Accepted

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

for i in range(n, 0, -1):
    del S[len(S)-1]
    if len(S)%2 == 0:
        str1=""
        str2=""
        for j in range(int(len(S)/2)):
            str1 = str1 + S[j]
        for j in range(int(len(S)/2), len(S)):
            str2 = str2 + S[j]
        if str1 == str2:
            print(len(S))
            break

Submission status: Accepted

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

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

while len(S) > 0 :
    S = S[0:-2]
    ans -= 2
    if S[0:ans//2] == S[ans//2:] :
        print(ans)
        sys.exit()
else :
    print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def check_word(word):
    return word[:int(len(word)/2)] == word[int(len(word)/2):len(word)]

a = input()
count = 0
for i in range(1, len(a)):
    b = a[:-i]
    if check_word(b):
        count = len(b)
        break
print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/python

ss = raw_input()

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

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

print(leng)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import deque
def main():
    s=deque(input())
    for i in range(0,len(s)):
        s.pop()
        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: Accepted

Solution code:
moji = input()
def isEvenStr(moji):
	length = len(moji)
	if length % 2 == 1:
		return None
	else:
		firsthalf = moji[0:int(length/2)]
		latterhalf = moji[int(length/2):int(length)]
		return firsthalf == latterhalf

for i in range(len(moji)-1,0,-1):
	trimmed = moji[0:i]
	isEven = isEvenStr(trimmed)
	if isEven:
		print(i)
		break

Submission status: Accepted

Solution code:
#Python
import sys

S = raw_input()

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

if S[0:len(S)/2]==S[len(S)/2:]:
	S=S[0:len(S)-2]

#print S
cnt=len(S)
while cnt>1:
	#print "cnt:::"+str(cnt)
	S1=S[0:len(S)/2]
	S2=S[len(S)/2:]
	#print S1
	#print S2
	if S1==S2:
		print len(S)
		sys.exit()

	S=S[0:len(S)-2]
	cnt-=2

Submission status: Accepted

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(msg))
            break
        msg = msg[:-2]


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#coding=UTF-8

S=input()
Slen=len(S)

for idx in range(Slen-2,0-1,-2):
    T=S[0:idx]

    Tlen=len(T)
    #hantei
    for idy in range(0,Tlen//2,1):
        if T[idy] !=T[Tlen//2+idy]:
            break
    else:
        ans=idx
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S = input().strip()
    for i in range(2, len(S), 2):
        part = S[:-i]
        p = len(part) // 2
        if part[:p] == part[p:]:
            print(p * 2)
            break

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = raw_input()

length = len(s)

for i in reversed(range(length)):
    s = s[:-1]
    l = len(s)
    tempa = l / 2
    temp = s
    s1 = temp[:tempa]
    s2 = temp[tempa:]
    
    if s1 == s2:
        print l
        break

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = raw_input()

def if_even(str):
    len_ = len(str)
    if len_ % 2:
        return 0
    str1 = str[:len_/2]
    str2 = str[len_/2:]
    if str1 == str2:
        # print str
        return 1
    else:
        return 0

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

print len(s)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
s = input()
sub = 0
for tmp in reversed(range(1,len(s)-2,2)):
    factor = s[0:tmp+1]
    sub += 2
    if factor[0:int(len(factor)/2)] == factor[int(len(factor)/2):len(factor)]:
        break
    else:
        pass
print(len(s)-sub)

Submission status: Accepted

Solution code:
import math
inf=float('inf')
s = input()
s=s[:-1]

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

N=len(s)

for i in range(N):
    h=int(len(s)/2)
    if (s[0:h-1]==s[h:-1]):

        print(len(s))
        quit()
    s=s[:-2]


quit()

Submission status: Accepted

Solution code:
import sys
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]))
        sys.exit()
print(0)

Submission status: Accepted

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

while 1:
    l = int(len(s)/2)
    if (s[:l]==s[l:] ):
        print(l*2)
        break
    else:
        s = s[:-2]
    if ( len(s)==0 ):
        break

Submission status: Accepted

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)
        break
    i+=2

if len(S)==2:
    print 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gu(s):
    l = len(s)
    if l%2 != 0:
        return 0
    else:
        ct = 0
        for i in range(l//2):
            if s[i] == s[i+(l//2)]:
                ct += 1
        if ct == (l/2):
            return 1
        else:
            return 0 





s = input()

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

print(len(s))

Submission status: Accepted

Solution code:

def main():
    s = raw_input()

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

    print r


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def equal(s1, s2):
    flag = True
    for i in range(len(s1)):
        if s1[i] != s2[i]:
            flag = False
            break
    return flag

S = list(input())

L = len(S)

ans = -1
for i in range(L):
    if (L - (i+1)) % 2 == 1:
        continue
    elif equal(S[:int((L - (i+1))/2)], S[int((L - (i+1))/2):(L - (i+1))]):
        ans = L - (i+1)
        break

print(ans)

Submission status: Accepted

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

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

    print(ans)

main()

Submission status: Accepted

Solution code:
s = input()

s = s[:-1]

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

while True:
    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(n):
	X = S[0:-2 * (i + 1)]
	x = S[0:int(n / 2) - i - 1]
	if X == x + x:
		count = i + 1
		break

print(n - count * 2)

Submission status: Accepted

Solution code:
def myfind(S):
	if (len(S) % 2 == 0):
		dv = len(S)//2
		f,e = S[:dv],S[dv:]
		if f == e: return True
	return False

if __name__ == '__main__':
	S = input()
	S = S[:-1]
	while not(myfind(S)): 
		S= S[:-1]
	print(len(S))

Submission status: Accepted

Solution code:
S = raw_input()

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

print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

def r(s):
    l = len(s)
    if(l%2 == 1):
        return r(s[:-1])
    elif(s[:int(l/2)] == s[int(l/2):]):
        return len(s)
    else:
        return r(s[:-1])
print(r(s[:-1]))

Submission status: Accepted

Solution code:
#! -*- coding:utf-8 -*-
s = str(input())
s = list(s)
#print(s)
a = 'x'
b = 'x'

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
s = input()[:-1]

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

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

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


S = raw_input()[:-1]
if len(S) % 2 != 0:
    S = S[:-1]
L = len(S)
for i in range(L):
    if check(S):
        break
    else:
        S = S[:-2]

print len(S)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S) - 2
if N % 2 == 1:
    N += 1
M = N // 2
while 1:
    if S[:M] == S[M:N]:
        print(N)
        exit()
    N -= 2
    M -= 1

Submission status: Accepted

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

s = raw_input()
flg = 1
slen = len(s)
while(flg):
    s = s[:slen-2]
    slen = len(s)
    m = slen/2
    if(s[:m]==s[m:]):
        print(2*m)
        flg = 0

Submission status: Accepted

Solution code:
import math


def f():
    a  = input()
    for i in range(1,len(a)):
        l = len(a) - i
        if l%2==1:
            continue
        d = l//2
        
        if a[:d] == a[d:-i]:
            print(d*2)
            return 
        
f()

Submission status: Accepted

Solution code:
S = raw_input()

S=S[:-2]
mid=len(S)/2
Sf=S[:mid]
Sl=S[mid:]

while Sf!=Sl:
  S=S[:-2]
  mid=len(S)/2
  Sf=S[:mid]
  Sl=S[mid:]

print(len(S))

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

for _ in range(l):
    cnt += 1
    S = S[:-1]
    #print(S)
    if len(S) % 2 == 1:
        continue
    f = True
    for i in range(len(S) // 2):
        if S[i] != S[len(S) // 2 + i]:
            f = False
            break
    if f:
        print(l - cnt)
        break

Submission status: Accepted

Solution code:
s = raw_input()

def is_rep(s0):
    l = len(s0)/2
    s1 = s0[:l]
    s2 = s0[l:]
    return s1 == s2

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

Submission status: Accepted

Solution code:


s = input()
for i in range(len(s)-1):
    sd = s[0:len(s)-i-1]
    if len(sd) % 2:
        continue

    sdd = sd[0:len(sd)//2]
    if sdd+sdd == sd:
        print(len(sd))
        break

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def is_ev_st(s):
    l = len(s)
    if l % 2 == 1:
        return False
    l2 = int(l / 2)
    return s[:l2] == s[l2:]


def main():
    S = get_ln_inputs()[0][:-1]
    while not is_ev_st(S):
        S = S[:-1]
    print(len(S))


main()

Submission status: Accepted

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

while True:
    if 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:
a = raw_input()

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

Submission status: Accepted

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

from __future__ import division, print_function
import sys


def main():
    s = sys.stdin.readline().strip()
    while True:
        s = s[:-2]
        i = len(s) // 2
        a = s[:i]
        b = s[i:]
        if a == b:
            print(len(s))
            return


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
s = input()
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: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
for i in range(int(len(s) + 1) / 2):
  if s[i] != s[int(len(s) + 1) / 2]:
    del[len(s) - 1]
print(len(s) + 1)

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
a = str(input())
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.pop(-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools
l = list(map(int,input().split()))

com = list(itertools.combinations(l,2))

k = []
for i in range(len(com)):
    k.append(sum(com[i]))
    
print(min(k))

Submission status: Runtime Error

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

Submission status: Runtime Error

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