ZhenlongDai/ACPR huggingface dataset:
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()

buf=list(S)

result=0

for i in S[-1::-1]:
    buf.remove(i)
    if(len(buf)%2==0):
        tmp="".join(buf[0:int(len(buf)/2)])
        if S.count(tmp)==2:
            result=len(buf)
            break

print(result)

Failing test case input:
abcabcabcaac

Expected output:
6


Actual output:
0


Fixed submission (verdict: Accepted):
S=input()

buf=list(S)

result=0

for i in range(len(S)):
    del buf[-1]
    if(len(buf)%2==0):
        tmp="".join(buf[0:int(len(buf)/2)])
        if "".join(buf).count(tmp)==2:
            result=len(buf)
            break

print(result)

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in range(len(s)-1):
    s = s[::-1]        
    s = s.replace(s[0],'',1)
    s = s[::-1] 
    a = s[0]
    for j in range(1,int(len(s)/2)+1):
        a += s[j]
        if a * (int(len(s)/len(a))) == s and int(len(s)/len(a)) % 2 == 0:
            print(len(a * (int(len(s)/len(a)))))
            exit()

Failing test case input:
aacbacaaabac

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
s = input()
for i in range(len(s)-1):
    s = s[::-1]        
    s = s.replace(s[0],'',1)
    s = s[::-1] 
    a = s[0]
    for j in range(1,int(len(s)/2)+1):
        a += s[j]
        if a * (int(len(s)/len(a))) == s and (int(len(s)/len(a)) % 2 == 0 or s.count(s[0]) == len(s)):
            print(len(a * (int(len(s)/len(a)))))
            exit()

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
s=s[:-1]

for i in s:
    if all(s.count(x)%2 == 0 for x in s):
        print(len(s))
        break
    else:
        s=s[:-1]
        

Failing test case input:
bbcacbaababc

Expected output:
2


Actual output:
10


Fixed submission (verdict: Accepted):
s=input()
s=s[:-1]

for i in range(len(s)):
    s_1=s[:len(s)
    s_2=s[len(s)
    if all(s.count(x)%2 == 0 for x in s) and s_1 == s_2 or len(s) == 2:
        print(len(s))
        break
    else:
        s=s[:-1]
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
bbaabcbacabc

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
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)

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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]
print(S)
while S != "":
    if judge(S):
        break
    S = S[:-2]

print(len(S))

Failing test case input:
bbbabcaacabc

Expected output:
2


Actual output:
bbbabcaaca
2


Fixed submission (verdict: Accepted):
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))

Problem: p03672
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
for i in range(2, len(S), 2):
    split = int(len(S[:-i])/2)
    if S[:split] == S[split:-i]:
        print(len(S[:-i]))


Failing test case input:
bbbbbbbad`bc

Expected output:
6


Actual output:
6
4
2


Fixed submission (verdict: Accepted):
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()

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

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


Failing test case input:
bbabbacb`ccb

Expected output:
6


Actual output:
6
2


Fixed submission (verdict: Accepted):
s = input()

for i in range(1, len(s)-1):
    l = len(s[:-i])
    if l % 2 != 0:
        continue
    else:
        if s[:int(l/2)] == s[int(l/2):-i]:
            print(l)
            break
        else:
            continue
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

Failing test case input:
akakskaakakas`saaaakas

Expected output:
4


Actual output:
2


Fixed submission (verdict: Accepted):

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

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
c=0
i=0
list1=[]
list2=[]


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


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

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

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

Failing test case input:
bba_bccacaab

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
c=0
i=0
list1=[]
list2=[]


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


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

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

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

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()


for i in range(len(s)):
    ans = s[:min(len(s), -(i+1))]
    if(len(ans)%2==1):
        continue
    else:
        mid = int(len(ans)/2)
        if(mid>0):
            if(ans[:mid]==ans[mid:]):
                print(mid*2)

Failing test case input:
bbabbacb`ccb

Expected output:
6


Actual output:
6
2


Fixed submission (verdict: Accepted):
s = input()


for i in range(len(s)):
    ans = s[:min(len(s), -(i+1))]
    if(len(ans)%2==1):
        continue
    else:
        mid = int(len(ans)/2)
        if(mid>=0):
            if(ans[:mid]==ans[mid:]):
                print(mid*2)
                break

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

while len(s) > 2:
  if len(s) % 2 == 0:
    s = s[:-2]
    mid = len(s) 
    if s[:mid] == s[mid:]:
      print(len(s))
  else:
    s = s[:-1]
    mid = len(s) 
    if s[:mid] == s[mid:]:
      print(len(s))

Failing test case input:
yyxw

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
s = list(input())

for _ in range(len(s)):
  if len(s) % 2 == 0:  
    s.pop()
    s.pop()
    if s[:(len(s))
      print(len(s))
      break
  else:
    s.pop()
    if s[:(len(s))
      print(len(s))
      break
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
string = input()
length = len(string)
for i in range(length):
    if length-(i+1)%2 != 0:
        continue
    else:
        if string[:(length-(i+1))/2] == string[(length-(i+1))/2:length-(i+1)]:
            print(length-(i+1))
            break


Failing test case input:
bbaabccacabc

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
string = input()
length = len(string)
for i in range(length):
    if (length-(i+1))%2 == 0:
        if string[0:int((length-(i+1))/2)] == string[int((length-(i+1))/2):length-(i+1)]:
            print(length-(i+1))
            break

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in reversed(range(len(s)-1)):
  if (i + 1) % 2 == 0:
    ss = s[:i+1]


    if ss[:int((i+1)/2)] == ss[int((i+1)/2):]:
      print(i+1)

Failing test case input:
bbbbbbbad`bc

Expected output:
6


Actual output:
6
4
2


Fixed submission (verdict: Accepted):
s = input()
for i in reversed(range(len(s)-1)):
  if (i + 1) % 2 == 0:
    ss = s[:i+1]


    if ss[:int((i+1)/2)] == ss[int((i+1)/2):]:
      print(i+1)
      exit()

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__ == "__main__":
    s = input()
    data = list(s)
    while len(data):
        data.pop()
        if len(data) % 2 == 0:
            half = int(len(data) / 2)
            if data[:half] == data[half:]:
                print(half)
                break

Failing test case input:
bbbabcbacabc

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
if __name__ == "__main__":
    s = input()
    data = list(s)
    while len(data):
        data.pop()
        if len(data) % 2 == 0:
            half = int(len(data) / 2)
            if data[:half] == data[half:]:
                print(len(data))
                break

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
bba`bccacaab

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
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)
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
xxyy

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
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)

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
N=len(S)-1
for i in range(0,N):
    s=S[0:N-i]
    print(s)
    n=len(s)
    if n%2==0:
        if s[0:int(n/2)]==s[int(n/2):n]:
            print(N-i)
            exit()

Failing test case input:
bbadcacbabbb

Expected output:
2


Actual output:
bbadcacbabb
bbadcacbab
bbadcacba
bbadcacb
bbadcac
bbadca
bbadc
bbad
bba
bb
2


Fixed submission (verdict: Accepted):
S=input()
N=len(S)-1
i=0
while(True):
    s=S[0:N-i]
    n=len(s)
    if n%2==0:
        if s[0:int(n/2)]==s[int(n/2):n]:
            print(N-i)
            break
    i+=1

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

for i in range(1, len(s)):
    ss = s[:-i]
    if ss == ss[::-1]:
        print(len(ss))
        exit()

Failing test case input:
akakaraakas`kbs`kaakas

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
s = input()
for i in range(len(s) 
    if s[:i] * 2 == s[:i*2]:
        print(i*2)
        exit()

Problem: p03672
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def isEvenStr(s):
  if len(s) % 2 == 1:
    return False
  elif s[0:int(len(s)/2)] == s[int(len(s)/2):]:
    return True
  else:
    return False

s = input()
i = 0
while not isEvenStr(s):
  s = s[:-1]
  i += 1
  if isEvenStr(s):
    print(i)

Failing test case input:
bbabaadb`ccb

Expected output:
2


Actual output:
10


Fixed submission (verdict: Accepted):
def isEvenStr(s):
  if len(s) % 2 == 1:
    return False
  elif s[0:int(len(s)/2)] == s[int(len(s)/2):]:
    return True
  else:
    return False

s = input()
l = len(s)
i = 0

while not isEvenStr(s) or i == 0:
  s = s[:-1]
  i += 1
  if isEvenStr(s):
    print(l - i)
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))


Failing test case input:
akakakaakarak`sasaakas

Expected output:
4


Actual output:
20


Fixed submission (verdict: Accepted):
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)
            a = a[:-1]
            flag = True



print(len(a))

Problem: p03672
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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

Failing test case input:
bbcaccaacabb

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
n = input()
num = len(n)-2
for i in range(num,0,-2):
  f = int(i/2)
  if n[:f]==n[f:i]:
    print(i)
    break

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

for i in reversed(range(1, int((len(s)-1)/2+1))):
    if(s[:i] == s[i:2*i]):
        print(2*i)


Failing test case input:
bbbbbbbadabc

Expected output:
6


Actual output:
6
4
2


Fixed submission (verdict: Accepted):
s = input()

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

Problem: p03672
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=list(input())
from copy import copy
t=s.copy()

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


Failing test case input:
bbcabc`ac`ac

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
s=list(input())
from copy import copy
t=s.copy()

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

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

for i in reversed(range(1, int((len(s))/2+1))):
    print(s[:i])
    print(s[i:2*i])
    if(s[:i] == s[i:2*i]):
        print(2*i)


Failing test case input:
akakskaakakas`saaaakas

Expected output:
4


Actual output:
akakskaakak
as`saaaakas
akakskaaka
kas`saaaak
akakskaak
akas`saaa
akakskaa
kakas`sa
akakska
akakas`
akaksk
aakaka
akaks
kaaka
akak
skaa
aka
ksk
ak
ak
4
a
k


Fixed submission (verdict: Accepted):
s = input()

for i in reversed(range(1, int((len(s)-1)/2+1))):
    if(s[:i] == s[i:2*i]):
        print(2*i)
        break
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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

       

Failing test case input:
bbbabbbacabc

Expected output:
8


Actual output:
7


Fixed submission (verdict: Accepted):
s = input()

for i in range(len(s)):
    s = s[:-1]
    if len(s) % 2 == 1:
        continue
    ss = s[len(s)
    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]

Problem: p03672
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S=list(input())

for i in range(len(S)):
    del S[-1]
    for j in range(len(S)):
        if S.count(S[j])%2!=0:
            break
    else:
        print(len(S))
        break
else:
  print(0)

Failing test case input:
aacbbcabaaac

Expected output:
2


Actual output:
6


Fixed submission (verdict: Accepted):
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)
                print(len(S))
                sys.exit()
else:
    print(0)

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
l = len(S)
for i in range(1,l-2):
  s = S[0:l-i]
  ls = len(s)
  if ls%2 == 0 and s[0:int(ls/2)] == s[int(ls/2):ls]:
    break
print(ls)

Failing test case input:
bba`bccacabc

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
S = input()
l = len(S)
for i in range(1,l-1):
  s = S[0:l-i]
  ls = len(s)
  if ls%2 == 0 and s[0:int(ls/2)] == s[int(ls/2):ls]:
    break
print(ls)

Problem: p03672
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = str(input())
cnt = 0

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

print(cnt)



Failing test case input:
aaakasaakkt`kbsakaak`s

Expected output:
2


Actual output:
20


Fixed submission (verdict: Accepted):
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))

Problem: p03672
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
s_list = list(S)
n = len(s_list)

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

Failing test case input:
abcabcabc`ac

Expected output:
6


Actual output:
1


Fixed submission (verdict: Accepted):
S = input()
s_list = list(S)
n = len(s_list)

for i in range(1,n):
    a = s_list[:-i]
    if len(a)%2 == 0:
        half = a[:int(len(a)/2)]
        
        if half + half == a:
            break
    
print(len(a))
Problem: p03672
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
def input(): return sys.stdin.readline().strip()


def main():
    s = input()
    l = len(s)
    ans = l
    for i in range(l):
        if i % 2 != 0: continue
        ns = s[:l-i]
        even = True
        for j, c in enumerate(ns):
            if c != ns[l-i-j-1]:
                even = False
                break
        if even:
            ans = l - i
    print(ans)


if __name__ == "__main__":
    main()


Failing test case input:
abcabcabc`ac

Expected output:
6


Actual output:
12


Fixed submission (verdict: Accepted):
import sys
def input(): return sys.stdin.readline().strip()


def main():
    s = input()
    l = len(s)
    ans = l - 2
    for i in range(2, l):
        if i % 2 != 0: continue
        ns = s[:l-i]
        even = True
        for j, c in enumerate(ns):
            if j >= (l - i) 
            if c != ns[(l - i) 
                even = False
                break
        if even:
            ans = l - i
            break
    print(ans)


if __name__ == "__main__":
    main()

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

s = input()
cnt = 0
cand_string = ''
cand_string_double = ''
for c in s:
    cand_string += c
    cand_string_double = cand_string * 2
    if cand_string_double == s[0:len(cand_string_double)]:
        print(len(cand_string_double))
        sys.exit()

Failing test case input:
bbbbbbbad`bc

Expected output:
6


Actual output:
2


Fixed submission (verdict: Accepted):
import sys

s = input()
cand_string = ''
cand_string_double = ''
for c in s:
    cand_string += c
    cand_string_double = cand_string * 2
    if cand_string_double == s[0:len(cand_string_double)] and len(cand_string_double) != len(s):
        ans = len(cand_string_double)
print(ans)

Problem: p03672
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
s=input().strip()
flg=True
while len(s)>=2:
    for i in range(len(s)):
        if s[i]!=s[-i-1]:
            flg=False
    if flg:
        print(s)
        exit()
    s=s[:-2]
    flg=True


Failing test case input:
abcabcbacabc

Expected output:
6


Actual output:

Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
s=input().strip()
flg=True

s=s[:-2]
while len(s)>=2:
    for i in range(len(s)
        if s[i]!=s[len(s)
            flg=False
    if flg:
        print(len(s))
        exit()
    s=s[:-2]
    flg=True

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
s=s[:-1]

for i in s:
    if all(s.count(x)%2 == 0 for x in s) or len(s) == 2:
        print(len(s))
        break
    else:
        s=s[:-1]

Failing test case input:
bbbabcaacabc

Expected output:
2


Actual output:
10


Fixed submission (verdict: Accepted):
s=input()
s=s[:-1]

for i in range(len(s)):
    s_1=s[:len(s)
    s_2=s[len(s)
    if all(s.count(x)%2 == 0 for x in s) and s_1 == s_2 or len(s) == 2:
        print(len(s))
        break
    else:
        s=s[:-1]
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S = input()

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

print(ans)

Failing test case input:
bbcabcaacaac

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):

S = input()

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

print(2 * ans)

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s_num = int(len(s)/2)
for i in range(s_num):
   s_re = s[0:2*i]
   if i!=0 and s_re[0:i] == s_re[i:2*i]:
      print(len(s_re))

Failing test case input:
aaaaaacabb

Expected output:
6


Actual output:
2
4
6


Fixed submission (verdict: Accepted):
s = input()
s_num = int(len(s)/2)
for i in range(s_num):
   s_re = s[0:2*i]
   if i!=0 and s_re[0:i] == s_re[i:2*i]:
      ss = len(s_re)

print(ss)

Problem: p03672
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
for i in range(int(len(s)/2)):
    tmp=s[:-int((i+1)*2)]
    a=0
    for j in range(int(len(tmp)/2)):
        if tmp[j]==tmp[-j-1]:
            a+=1
    if a==int(len(tmp)/2):
        print(len(tmp))
        exit()

Failing test case input:
cbacbacbacbb

Expected output:
6


Actual output:
0


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

Problem: p03672
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s = input()
s = list(s)

ans = []

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

Failing test case input:
akakakaakasak`sasaakas

Expected output:
4


Actual output:
0


Fixed submission (verdict: Accepted):
s = input()
s = list(s)

ans = []

for i in range(len(s)):
  tmp = s[0:len(s)-(i+1)]
  
  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))
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
bbabaadb`ccb

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
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)

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
ans = 0
for i in range(1,len(s)+1):
    if s[:i*2].count(s[:i]) == 2:
        ans = len(s[:i]) * 2
        break
print(ans)

Failing test case input:
bbabbacb`ccb

Expected output:
6


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
ans = 0
for i in range(1,len(s)+1
    if s[:i*2].count(s[:i]) == 2:
        if len(s[:i]) * 2 != len(s):
            ans = len(s[:i]) * 2
print(ans)

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
n=len(s)
for i in range(1,n+1):
  if s[0:i]==s[i:i+i]:
    print(i)
    break


Failing test case input:
abcabcabcaac

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):
s=input()
n=len(s)
for i in range(n
  if i*2==n:
    continue
  if s[0:i]==s[i:i+i]:
    print(i+i)
    break

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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)


Failing test case input:
bbacbaccaccb

Expected output:
2


Actual output:
10


Fixed submission (verdict: Accepted):

s = input()
n = len(s)
count = 1   
 
if n % 2 == 1 - count:
    count += 1
 
while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2
 
print(n-count)
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
l = [str(x) for x in list(str(S))]
for i in range(int(len(l)/2)):
    l.pop(-1)
    if len(l) % 2 == 0:
        tmp = "".join(l)
        if tmp[:int(len(l)/2)] == tmp[int(len(l)/2):]:
            print(len(l))
            break
        else:
            continue
    else:
        continue

Failing test case input:
akakakaakasak`sasaakas

Expected output:
4


Actual output:

Fixed submission (verdict: Accepted):
S = str(input())
l = [str(x) for x in list(str(S))]
for i in range(int(len(l)/2)):
    l.pop(-1)
    l.pop(-1)
    tmp = "".join(l)
    if tmp[:int(len(l)/2)] == tmp[int(len(l)/2):]:
        print(len(l))
        break
    else:
        continue

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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)


Failing test case input:
abaababaab

Expected output:
6

Actual output:
5


Fixed submission (verdict: Accepted):

s = input()
n = len(s)
count = 1   
 
if n % 2 == 1 - count:
    count += 1
 
while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2
 
print(n-count)

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
n=len(s)
for i in range(n):
    s=s[:-1]
    if len(s)%2==0:
        if s[:int(len(s)/2)+1]==s[int(len(s)/2)+1:]:
            print(len(s))
            break


Failing test case input:
bbbabcaacabc

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
s=input()
n=len(s)
for i in range(n):
    s=s[:-1]
    if len(s)%2==0:
        if s[:int(len(s)/2)]==s[int(len(s)/2):]:
            print(len(s))
            break

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
if len(a)%2==1:a=a[:-1]
while a[0:int(len(a)/2)]!=a[int((len(a)/2)):len(a)]:
  a=a[:-2]
print(len(a))

Failing test case input:
akasakaakasakasakaakas

Expected output:
14

Actual output:
22


Fixed submission (verdict: Accepted):
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))

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in range(len(s)):
    str = s[:-i]
    
    str_half_length = int(len(str) / 2)
    
    str_1 = str[str_half_length:]
    str_2 = str[:str_half_length]
    if str_1 == str_2 and i != 0:
        print(str_half_length * 2)


Failing test case input:
bbbbbbbadabc

Expected output:
6


Actual output:
6
4
2


Fixed submission (verdict: Accepted):
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()
Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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


Failing test case input:
yyyx

Expected output:
2


Actual output:
y y
2


Fixed submission (verdict: Accepted):
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

Problem: p03672
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

s = input()
n = len(s)
count = 1   
 
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)

Failing test case input:
bbcabbaacabc

Expected output:
2


Actual output:
-25


Fixed submission (verdict: Accepted):

s = input()
n = len(s)
count = 1   
 
if n % 2 == 1 - count:
    count += 1
 
while s[0 : int((n-count)/2)] != s[int((n-count)/2) : n-count]:
    count += 2
 
print(n-count)

Problem: p03672
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=list(input())
from copy import copy
t=s.copy()

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


Failing test case input:
bbcabc`ac`ac

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
s=list(input())
from copy import copy
t=s.copy()

for i in range(len(t)):
  p=int(len(s)/2)
  if len(s)%2==0 and s[:p]==s[p:] and len(s)!=len(t):
    print(len(s))
    exit()
  else:
    s.pop(-1)
Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


N,M = map(int,input().split())
A = list(map(int,input().split()))

ans = N-sum(A)
print(ans)







Failing test case input:
253 15
8 23 6 35 8 9 79 3 23 8 46 2 1 47 3

Expected output:
-1


Actual output:
-48


Fixed submission (verdict: Accepted):


N,M = map(int,input().split())
A = list(map(int,input().split()))

ans = N-sum(A)

if ans <0:
    print(-1)
else:
    print(ans)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())

A = [int(i) for i in range(M)]

B = sum(A)

if N <= B:
  print(N-B)

else:
  print('-1')

Failing test case input:
14 2
3 6

Expected output:
5


Actual output:
-1


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())

A = [int(i) for i in input().split()]

B = sum(A)

if N >= B:
  print(N-B)

else:
  print('-1')

Problem: p02706
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=sum(b)

if(c > a[0]):
    print(-1)
else:
    print(c - a[0])

Failing test case input:
499 15
4 23 5 35 8 9 79 5 23 8 46 2 1 47 3

Expected output:
201


Actual output:
-201


Fixed submission (verdict: Accepted):
a=[int(x) for x in input().split()]
b=[int(x) for x in input().split()]
c=sum(b)

if(c > a[0]):
    print(-1)
else:
    print(a[0] - c)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m=map(int,input().split())
a=list(map(int,input().split()))
if sum(a)-n >= 0:
    print(sum(a)-n)
else:
    print(-1)

Failing test case input:
314 25
9 24 5 7 5 35 19 3 23 8 27 0 1 43 0

Expected output:
105


Actual output:
-1


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
a=list(map(int,input().split()))
if n-sum(a) >= 0:
    print(n-sum(a))
else:
    print(-1)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def b163(n, m, al):


    return n - sum(al) if n - sum(al) < 0 else "-1"

def main():
    n , m = map(int, input().split())
    al = list(map(int, input().split()))
    print(b163(n, m, al))

if __name__ == '__main__':
    main()

Failing test case input:
68 2
9 9

Expected output:
50


Actual output:
-1


Fixed submission (verdict: Accepted):
def b163(n, m, al):


    return n - sum(al) if n - sum(al) >= 0 else "-1"

def main():
    n , m = map(int, input().split())
    al = list(map(int, input().split()))
    print(b163(n, m, al))

if __name__ == '__main__':
    main()

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
if __name__ == "__main__":
    n, m = map(int, input().split())
    al = list(map(int, input().split()))
    al.sort()
    res = sum(al[:m])
    print(n - res)


Failing test case input:
3 2
7 8

Expected output:
-1


Actual output:
-12


Fixed submission (verdict: Accepted):
if __name__ == "__main__":
    n, m = map(int, input().split())
    al = list(map(int, input().split()))
    res = sum(al[:m])
    res = n - res
    if res < 0:
        print("-1")
    else:
        print(res)
Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def q2():
    N, M = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    sum_A = sum(A)
    if N > sum_A:
        ans = N - sum_A
    else:
        ans = 0
    print(ans)


if __name__ == '__main__':
    q2()


Failing test case input:
3 2
7 4

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
def q2():
    N, M = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    sum_A = sum(A)
    if N >= sum_A:
        ans = N - sum_A
    else:
        ans = -1
    print(ans)


if __name__ == '__main__':
    q2()

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())
lists = list(map(int, input().split()))

sum_home_day = sum(lists)

print(N - sum_home_day)

Failing test case input:
28 15
8 23 0 34 5 16 151 1 23 8 46 0 0 70 1

Expected output:
-1


Actual output:
-358


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
lists = list(map(int, input().split()))

sum_home_day = sum(lists)

if N < sum_home_day:
    print(-1)
else:
    print(N - sum_home_day)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int, input().split())
day_list = list(map(int, input().split()))

sum_day = sum(day_list)
print(n - sum_day)

Failing test case input:
28 15
8 23 1 34 5 16 130 3 23 8 46 0 0 70 1

Expected output:
-1


Actual output:
-340


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
day_list = list(map(int, input().split()))

sum_day = sum(day_list)
remain_day = n - sum_day
if remain_day >= 0:
    print(remain_day)
else:
    print(-1)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
nm = list(map(int, input().split()))
am = list(map(int, input().split()))
x = 0
for i in range(len(am)):
    x += am[i]
if x > nm[0]:
    print('-1')
else:
    print(x)

Failing test case input:
253 15
9 23 5 8 3 9 19 3 8 8 46 2 3 47 2

Expected output:
58


Actual output:
195


Fixed submission (verdict: Accepted):
nm = list(map(int, input().split()))
am = list(map(int, input().split()))
x = 0
for i in range(len(am)):
    x += am[i]
if x > nm[0]:
    print('-1')
else:
    ans = nm[0] - x
    print(ans)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int, input().split())
a = list(map(int, input().split()))

print(n-sum(a))         

Failing test case input:
253 15
8 23 1 34 5 16 79 3 23 8 46 0 0 70 1

Expected output:
-1


Actual output:
-64


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
a = list(map(int, input().split()))

hw = sum(a)

if n >= hw:
  print(n - hw)         
else:
  print(-1)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())
A = list(map(int, input().split()))
print(N-(sum(A)))

Failing test case input:
0 2
2 1

Expected output:
-1


Actual output:
-3


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
A = list(map(int, input().split()))
ans = sum(A)

if ans > N:
    print('-1')
else:
    print(N-ans)
Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())
A = list(map(int, input().split()))
print(N - sum(A))

Failing test case input:
0 2
2 14

Expected output:
-1


Actual output:
-16


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
A = list(map(int, input().split()))
rest = N - sum(A)
if rest < 0:
  print(-1)
else:
  print(rest)

Problem: p02706
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,m=map(int,input().split())
arr=list(map(int,input().split()))
print(n-sum(arr))

Failing test case input:
253 15
8 23 6 35 8 9 79 3 23 8 46 2 1 47 3

Expected output:
-1


Actual output:
-48


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
arr=list(map(int,input().split()))
va=n-sum(arr)
if va<0:
  print("-1")
else:
  print(va)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b=map(int,input().split())
c=list(map(int,input().split()))
print(a-sum(c))

Failing test case input:
0 2
2 14

Expected output:
-1


Actual output:
-16


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
c=list(map(int,input().split()))
c=sum(c)
if a<c:
  print(-1)
else:
  print(a-c)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
M,N=map(int,input().split())
A=list(map(int,input().split()))
a=sum(A)
print(M-a)

Failing test case input:
253 15
9 23 5 35 8 9 79 3 23 8 46 2 6 43 3

Expected output:
-1


Actual output:
-49


Fixed submission (verdict: Accepted):
N,M=map(int,input().split())
A=list(map(int,input().split()))
a=sum(A)
b=N-a
if b<0:
    print("-1")
else:
    print(b)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math

def main():
    N, M = map(int, input().split())
    A = sum(list(map(int, input().split())))
    print(N - A)

    return 0

if __name__ == '__main__':
    main()

Failing test case input:
253 15
8 23 6 35 8 16 79 3 23 8 46 0 0 47 3

Expected output:
-1


Actual output:
-52


Fixed submission (verdict: Accepted):
import math

def main():
    N, M = map(int, input().split())
    A = sum(list(map(int, input().split())))
    print(max(-1, N - A))

    return 0

if __name__ == '__main__':
    main()

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
d, n = list(map(int, input().split()))
work = list(map(int, input().split()))
sumwork = sum(work)
ans = d - sumwork
print(ans)

Failing test case input:
0 2
6 8

Expected output:
-1


Actual output:
-14


Fixed submission (verdict: Accepted):
a, b = list(map(int, input().strip().split()))
c = list(map(int, input().split()))
d = a - sum(c)
print(d if d >= 0 else '-1')

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m=map(int,input().split())
a=list(map(int,input().split()))

if(sum(a)>m):
	print(-1)
else:
	val=n-sum(a)
	print(val)

Failing test case input:
14 2
3 6

Expected output:
5


Actual output:
-1


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
a=list(map(int,input().split()))

if(sum(a)>n):
	print(-1)
else:
	val=n-sum(a)
	print(val)
Problem: p02706
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N, M = map(int, input().split())
A = [int(a) for a in input().split()]
asum = sum(A)
if N > asum:
    print(N - asum)
else:
    print(-1)


Failing test case input:
11 2
5 6

Expected output:
0

Actual output:
-1


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
A = [int(a) for a in input().split()]
asum = sum(A)
if N >= asum:
    print(N - asum)
else:
    print(-1)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m =  map(int,input().split())	

a = list(map(int,input().split()))

sum_a = sum(a)
print(n-sum_a)


Failing test case input:
0 1
5 2

Expected output:
-1


Actual output:
-7


Fixed submission (verdict: Accepted):
n, m =  map(int,input().split())
a = list(map(int,input().split()))
sum_a = sum(a)
ans = n-sum_a
if ans < 0:
    ans = -1
print(ans)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b = map(int,input().split())
c = [int(x) for x in input().split()]
print(c,len(c))
csum = 0
for i in range(len(c)):
    csum = csum + c[i]
if a>=csum:
    print(a-csum)
else:
    print(-1)

Failing test case input:
253 15
8 23 6 35 8 9 79 3 23 8 46 2 1 47 3

Expected output:
-1


Actual output:
[8, 23, 6, 35, 8, 9, 79, 3, 23, 8, 46, 2, 1, 47, 3] 15
-1


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
c = [int(x) for x in input().split()]
csum = 0
for i in range(len(c)):
    csum = csum + c[i]
if a>=csum:
    print(a-csum)
else:
    print(-1)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m=map(int,input().split())
list1=list(map(int,input().split()))
ans=n-sum(list1)
print(ans if ans>=0 else 0)
  

Failing test case input:
253 15
8 23 6 35 5 16 79 3 23 8 46 0 0 70 5

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
list1=list(map(int,input().split()))
ans=n-sum(list1)
print(ans if ans>=0 else -1)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M = map(int,input().split())
A = list(map(int, input().split()))
toA = sum(A)
print(N - toA)

Failing test case input:
28 15
8 23 0 34 5 16 130 1 23 8 46 0 0 70 1

Expected output:
-1


Actual output:
-337


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
A = list(map(int, input().split()))
toA = sum(A)
goke = N - toA
if goke < 0:
    print(-1)
else:
    print(goke)

Problem: p02706
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,M  = map(int,input().split())
A  = list(map(int,input().split()))

print(N - sum(A))

Failing test case input:
-1 2
2 1

Expected output:
-1


Actual output:
-4


Fixed submission (verdict: Accepted):
N,M  = map(int,input().split())
A  = list(map(int,input().split()))

if N - sum(A) > -1:
  print(N - sum(A))
else:
  print("-1")
Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int, input().split())
days = list(map(int, input().split()))
days = sum(days)
if n - days > 0:
  print(n - days)
else:
  print("−1")

Failing test case input:
253 15
8 23 1 34 5 16 130 3 23 8 46 0 0 70 1

Expected output:
-1


Actual output:
−1


Fixed submission (verdict: Accepted):
def days():
  n, m = map(int, input().split())
  days = list(map(int, input().split()))
  days = sum(days)
  if n - days >= 0:
    return n - days
  else:
    return -1
result = days()
print(result)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int,input().split())
a = list(map(int,input().split()))

total = sum(a)

if (n - total) > 0:
    print(n - total)
else:
    print('-1')

Failing test case input:
11 2
5 6

Expected output:
0

Actual output:
-1


Fixed submission (verdict: Accepted):
n, m = map(int,input().split())
a = list(map(int,input().split()))

total = sum(a)

if (n - total) >= 0:
    print(n - total)
else:
    print('-1')

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m=map(int,input().split())
a=list(map(int,input().split()))

print(n-sum(a))



Failing test case input:
0 2
2 1

Expected output:
-1


Actual output:
-3


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
a=list(map(int,input().split()))
if n-sum(a) >= 0:
  print(n-sum(a))
else:
  print(-1)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M=map(int, input().split()) 
A=list(map(int, input().split())) 
leftdays = N-sum(A)
print(leftdays)

Failing test case input:
253 15
8 23 6 35 5 16 79 3 23 8 46 0 0 47 5

Expected output:
-1


Actual output:
-51


Fixed submission (verdict: Accepted):
N,M=map(int, input().split()) 
A=list(map(int, input().split())) 
leftdays = N-sum(A)
leftdays = -1 if leftdays<0 else leftdays
print(leftdays)

Problem: p02706
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int, input().split())
c = list(map(int, input().split()))

d = sum(c)

if a - d >= 1:
  print(a - d)
else:
  print("-1")

Failing test case input:
11 2
5 6

Expected output:
0

Actual output:
-1


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
c = list(map(int, input().split()))

d = sum(c)

if a - d >= 0:
  print(a - d)
else:
  print("-1")

Problem: p02706
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,m = map(int,input().split())
li = input().split()

t=0
for i in li:
    t+=int(i)
print(n-t)

Failing test case input:
253 15
9 23 5 35 8 9 79 3 23 8 46 2 6 43 3

Expected output:
-1


Actual output:
-49


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
li = input().split()

t=0
for i in li:
    t+=int(i)
if n-t < 0:
    print(-1)
else:
    print(n-t)