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


def is_ss(t):
    if len(t) % 2 or t[:len(t)//2] != t[len(t)//2:]:
        return False
    else:
        return True


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://beta.atcoder.jp/contests/abc066/tasks/abc066_b


def solve():
    s = input()
    if len(s) % 2 == 0:
        s = s[:-2]
    else:
        s = s[:-1]

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
s = input()

for i in range(2,len(s),2):
    p_ans = s[:-i]
    half = len(p_ans)//2

    if p_ans[:half] == p_ans[half:]:
        print(len(p_ans))
        break

Submission status: Accepted

Solution code:
s = input()
ans=1

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

Submission status: Accepted

Solution code:
s = input()

for i in range(2, len(s) , 2):
    new_s = s[0:-i:]

    if new_s[0:len(new_s)//2:] == new_s[len(new_s)//2::]:
        print(len(new_s))
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())
a.pop()
a.pop()

while a:
  if a[:int(len(a)/2)] == a[int(len(a)/2):]:
    print(len(a))
    break
  else:
    a.pop()
    a.pop()

Submission status: Accepted

Solution code:
a = list(input())
ans = "f"
while ans != "t":
    del a[len(a)-1]
    if len(a) % 2 == 0:
        if a[0:len(a) // 2] == a[len(a) // 2:len(a)]:
            print(len(a))
            ans = "t"

Submission status: Accepted

Solution code:
S = input().rstrip()

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

n = 0
while True:
    n = len(S)
    mid = int(n / 2)
    if S[:mid] == S[mid:n]:
        break

    S = S[:n - 2]


print(n)

Submission status: Accepted

Solution code:
S = input()
str = list(S)
n = len(str)
for i in range(n):
  str.pop(-1)
  if len(str)%2 == 1:
    pass
  else:
    x = len(str)/2
    X = int(x)
    str1 = str[:X]
    str2 = str[X:]
    if str1 == str2:
      break
y = len(str1)*2
print(y)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
def judge(s):
    if len(s) % 2 == 0:
        if s[:(len(s)//2)] == s[len(s)//2:]:
            return True
        else:
            return False
    else:
        return False
ans = 0
for i in range(len(S)):
    if judge(S[:i]):
        ans = i
print(ans)

Submission status: Accepted

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

while True:
        s = s[0:length-2]
        length -= 2
        if s[0:int(length/2)] == s[int(length/2):length]:
                print(length)
                break

Submission status: Accepted

Solution code:
S = list(input())
for i in range(int(len(S)/2)):
  S.pop(-1)
  S.pop(-1)
  S_1 = S[:int(len(S)/2)]
  S_2 = S[int(len(S)/2):]
  if S_1 == S_2:
    print(2*len(S_1))
    break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
for i in range(N):
	n = N - i - 1	#i+1文字消したときの長さ
	if n % 2 == 0:	#それが偶数のとき処理する
		h = n // 2	#半分のところ
		if S[:h]==S[h:n]:
			ans = S[:h]+S[h:n]
			break

print(len(ans))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
s=input()
ns=s

def check_even_string(ss):
  l=int(len(ss)/2)
  return ss[l:]==ss[:l]

while True:
  ns=ns[:-2]
  if check_even_string(ns):
    break

print(len(ns))

Submission status: Accepted

Solution code:
## ABC 066
import sys

s = input()
s = list(s)

s.pop()
while(len(s) >= 2):
    if(s[:int(len(s)/2)] == s[int(len(s)/2):]):
        print(len(s))
        sys.exit()
    else:
        s.pop()

Submission status: Accepted

Solution code:
from sys import stdin


def main() -> int:
    s = next_str()
    cnt = 0

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

    print(cnt)
    return 0


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())
S.pop(len(S) - 1)
count = 0
while True:
    if len(S) % 2 != 0:
        S.pop(len(S) - 1)
        continue
    mid = int(len(S) / 2)
    for i in range(mid):
        if S[i] == S[i + mid]:
            count += 1
    else:
        if count == mid:
            print(len(S))
            break
        else:
            count = 0
            S.pop(len(S) - 1)

Submission status: Accepted

Solution code:
s = input()
for i in range(len(s)):
    str = s[:-(i+1)]
    str_half_length = int(len(str) / 2)
    str_1 = str[str_half_length:]
    str_2 = str[:str_half_length]
    if str_1 == str_2:
        print(str_half_length * 2)
        exit()

Submission status: Accepted

Solution code:
S = list(input())
S.pop(len(S) - 1)
count = 0
while True:
    if len(S) % 2 != 0:
        S.pop(len(S) - 1)
        continue
    mid = int(len(S) / 2)
    for i in range(mid):
        if S[i] == S[i + mid]:
            count += 1
    else:
        if count == mid:
            print(len(S))
            break
        else:
            count = 0
            S.pop(len(S) - 1)

Submission status: Accepted

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

    while True:
        # print(S[0:counter//2], "===", S[counter//2:counter])
        if counter%2 == 1:
            counter-=1
            continue
        if S[0:counter//2] == S[counter//2:counter] and counter!=len(S):
            break

        counter-=1
    
    print(abs(counter))

main()

Submission status: Accepted

Solution code:
s = input()
res = 0

for i in range(len(s)):
	if s[0:i] == s[i:2*i]:
		if (len(s[0:i])*2 != 0 and len(s[0:i])*2 != len(s)) and len(s[0:i])*2 > res:
			res = len(s[0:i])*2
s = s[::-1]
for i in range(len(s)):
	if s[0:i] == s[i:2*i]:
		if (len(s[0:i])*2 != 0 and len(s[0:i])*2 != len(s)) and len(s[0:i])*2 > res:
			res = len(s[0:i])*2

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_evenstr(s):
    n = len(s)
    if n%2 == 1: 
        return False
    return s[:n//2] == s[n//2:]

S = input()
while S != "":
    S = S[:-1]
    if is_evenstr(S):
        print(len(S))
        break

Submission status: Accepted

Solution code:
s=input()

flag = True

i=1
while flag:
  s = s[:-i]
  if len(s)%2==0:
    mid = (len(s)//2 -1)
    if s[mid+1:] == s[:mid+1]:
      print(len(s))
      exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

s.pop(-1)

if len(s)%2==1:
	s.pop(-1)
q = len(s)
for i in range(q//2):
	a =s[:len(s)//2]
	b =s[len(s)//2:]

	if a==b:
		print(len(a)*2)
		break
	else:
		s.pop(-1)
		s.pop(-1)
else:
	print(-1)

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
i = int((len(s)-3)/2)
while i >= 0:
  if s[0:i] == s[i+1:2*i+1]:
    print(2*(i+1))
    break
  i -= 1

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
    if i == 0:
        pass

    else:
        tmp = s[0 : len(s) - 2 * i]
        f = tmp[: len(tmp) // 2]
        l = tmp[len(tmp) // 2 :]
        if f == l:
            print(len(tmp))
            exit(0)

Submission status: Accepted

Solution code:
# coding:utf-8

INF = float('inf')


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


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

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

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

Submission status: Accepted

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

while True:
    if list_s[:len(list_s)//2] == list_s[len(list_s)//2:]:
        print(len(list_s))
        break
    else:
        del list_s[-1]
        del list_s[-1]

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def is_evenstr(s):
    if len(s)%2 != 0:
        return False
    else:
        k = len(s)//2
        s1 = s[:k]
        s2 = s[k:]
        if s1 == s2:
            return True
        else:
            return False

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

s = ns()

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

Submission status: Accepted

Solution code:
def judge(S):
    half = int(len(S)/2)
    if S[:half] == S[half:]:
        return True
    else:
        return False

S= input()
l = len(S)
if l%2 == 1:
    S = S[:-1]
else:
    S = S[:-2]
while S != "":
    if judge(S):
        break
    S = S[:-2]

print(len(S))

Submission status: Accepted

Solution code:
s = input()

i = 2
while len(s) - i > 0:
    a = s[:len(s)-i]
    b1 = a[:len(a)//2]
    b2 = a[len(a)//2:]
    if b1 == b2:
        print(len(a))
        break
    i += 2

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)
for i in range(l) :
    S.pop(-1)
    if i % 2 != 0 :
        A = S[0:len(S)//2]
        B = S[len(S)//2:len(S)]
        if A == B :
            print(len(S))
            break

Submission status: Accepted

Solution code:
S=input()

L=len(S)

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

print(i*2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def che(s):
    lens = len(s)
    if s[:lens//2] == s[lens//2:]:
        TF = True
    else:
        TF = False
    return TF

S = input()
TF = False
ind = 0

if len(S)%2 == 1:
    S2 = S[:-2]
else:
    S2 = S[:-2]
while True:
    TF = che(S2)
    if TF == False:
        S2 = S2[:-2]
    else:
        ans = len(S2)
        print(ans)
        exit()

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:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    S = input()
    for i in range(len(S)):
        t = S[:-i - 1]
        if len(t) % 2 == 0:
            if t[:len(t) // 2] == t[len(t) // 2:]:
                print(len(t))
                return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()


def check_even(stri):
    if len(stri) % 2 !=0:
        return False
    else:
        half = int(len(stri)/2)
        if stri[:half] == stri[half:]:
            return True
        else:
            return False


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

Submission status: Accepted

Solution code:
S=input()
for i in range(len(S)):
    if S[:i]==S[i:i+i] and len(S[:i])*2!=len(S):
        ans=S[:i]
print(len(ans)*2)

Submission status: Accepted

Solution code:
S = input()
S = S[:-1]
def judge_odd(S):
    # print(S)
    temp_len = len(S)/2
    temp_a = S[:int(len(S)/2)]
    temp_b = S[int(len(S)/2):]
    # print("temp_a={}".format(temp_a))
    # print("temp_b={}".format(temp_b))
    if temp_a == temp_b:
        return False
    else:
        return True
judge = True
if len(S)%2 != 0:
    S = S[:-1]
while judge:
    judge = judge_odd(S)
    if judge:
        S = S[:-2]
print(len(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=input()
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()
while 1:
    s = s[:-2]
    i = len(s)//2
    if s[:i] == s[i:]:
        break
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


# --------------------------------------------

dp = None


def is_even_str(s):
    return s[:len(s) // 2] == s[len(s) // 2:]


def main():
    S = input()

    for i in range(2, 99999, 2):
        if is_even_str(S[:len(S) - i]):
            print(len(S) - i)
            return


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input();
a=(len(s)-1)//2;
while 1:
    f=1;
    for i in range(a):f=f and s[i]==s[a+i]
    if f:
        print(a*2)
        exit()
    a-=1

Submission status: Accepted

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

while len(s)>0:
    if s[:int(len(s)/2)]==s[int(len(s)/2):]:
        print(len(s))
        sys.exit()
    s.pop(len(s)-1)
    s.pop(len(s)-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#66b
s = input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

def main():
    s = input()[::-1]

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

    if s[:i] == s[i:]:
        break

print(len(s))

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

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

S = input()

def check(S):
	if len(S)%2 == 1:
		return False
	else:
		L = len(S)//2
		return S[:L] == S[L:]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
def hoge(s):
    if s[:len(s)//2] == s[len(s)//2:]:
        return 1
    else:
        return 0
ans = len(s)-1
s = s[:-1]
while True:
    if hoge(s):
        print(ans)
        exit()
    s = s[:-1]
    ans -= 1

Submission status: Accepted

Solution code:
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 = input()
i = 2
while True:
    if S[:(len(S) - i) // 2] * 2 == S[:len(S) - i]:
        print(len(S) - i)
        break
    i += 2

Submission status: Accepted

Solution code:
s = input()
while (len(s) > 0):
    s = s[:-2]#末尾を二文字減らす
    p = int(len(s)/2)
    if s[:p] == s[p:]:
        break
print(len(s))

Submission status: Accepted

Solution code:
s = raw_input()[:-1]
while len(s) % 2 or s[:len(s)/2] != s[len(s)/2:]:
	s = s[:-1]
print len(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

N=len(S)

for i in range(N-1, -1, -1):
    if i%2==0:
        a=''.join(S[0:i//2])
        b=''.join(S[i//2:i])
        if a==b:
            break

print(i)

Submission status: Accepted

Solution code:
S = input()

resString = ''

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

s = list(input())

del s[len(s) - 1]

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

  if flag:
    print(len(s))
    sys.exit()
  else:
    del s[len(s) - 1]

Submission status: Accepted

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

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:
"""
https://abc066.contest.atcoder.jp/tasks/abc066_b
"""
s=input()
a=0
for i in range(len(s)):
    if len(s)%2==0 and a!=0 and s[0:int(len(s)/2)]==s[int(len(s)/2):len(s)+1]:
        print(len(s))
        break
    else:
        s=s[0:len(s)-1]
    #print(s)
    a=a+1
    #print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = input()

for i in range(1, len(S)):
    # 必要な部分の切り出し
    str1 = S[:len(S)-i]
    # 文字数が奇数ならそもそも論外
    if len(str1) % 2 != 0:
        continue
    # 前半部分と後半部分の比較
    tmp = len(str1)/2
    if str1[:len(str1)//2] == str1[len(str1)//2:]:
        print(len(str1))
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# input
S = input()

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

print(2 * ans)

Submission status: Accepted

Solution code:
input_string = input()
input_list = []

for i in input_string:
    input_list.append(i)

if len(input_string) % 2 == 1:
    length = int((len(input_string) - 1)/2)
    input_list.pop()
else:
    length = int((len(input_string) - 2)/2)
    input_list.pop()
    input_list.pop()

while length > 0:
    if input_list[:length] == input_list[length:]:
        print(len(input_list))
        break
    else:
        length -= 1
        input_list.pop()
        input_list.pop()

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
i = -1
while(True):
    s = S[:i]
    if len(s)%2 != 0:
        i -= 1
        continue

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

Submission status: Accepted

Solution code:
s = list(input())
for i in range(1,len(s)):
    del s[-1]
    l = len(s)
    m = int(l/2)
    if l % 2 == 1:
        pass
    elif s[:m] == s[m:]:
        break
print(len(s))

Submission status: Accepted

Solution code:
s = input()
n = len(s)
check = True
i = 2
while check:
    if s[0:(n-i)//2] == s[(n-i)//2:(n-i)]:
        check = False
    else:
        i += 2
print(n-i)

Submission status: Accepted

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

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

length = len(S)

notsame = True

while notsame:
    half = int(length/2)
    left = S[0:half]
    right = S[half:length]
    if right == left:
        notsame = False
        print(length)
    else:
        S = S[:-2]
        length = len(S)

Submission status: Accepted

Solution code:
s=input().strip()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if len(s) % 2 != 0:
    s = s[:-1]
else:
    s = s[: -2]
flag = False
while not flag:
    m = len(s) // 2
    if s[:m] == s[m:]:
        flag = True
    else:
        s = s[:-2]

print(len(s))

Submission status: Accepted

Solution code:
def f(a):
    return a[:len(a) // 2] == a[len(a) // 2:]

a = input()[:-1]
while a:
    if f(a):
        print(len(a))
        exit()
    else:
        a = a[:-1]
print(0)

Submission status: Accepted

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

Submission status: Accepted

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