Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
 N = int(input())
x = N
y = N
ansx = N
ansy = N
n = int(N**0.5)
for i in range(x+1):
    if i+1 > n:
        break
    for j in range(y+1):
        if j+1 > x+1:
            break
        if i*j == N:
            if ansx + ansy >i+j:
                ansx,ansy = i,j

print(ansx + ansy -2)

Fixed submission:
N = int(input())
x = N
y = N
ansx = N
ansy = N
ans = []
n = int(N**0.5)
if N**0.5 == int(N**0.5):
    print(int(N**0.5)*2-2)
else:
    for i in range(n+1):
        if N%(i+1) == 0:
            ans.append(i+1)
    ans.append(N)
    if(ans[1]==N):
        print(N-1)
    else:
        for i in range(len(ans)):
            if ansx+ansy>ans[i] + int(N//ans[i]):
                ansx = ans[i]
                ansy =int(N//ans[i])
        print(ansx + ansy -2)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
x = N
y = N
ansx = N
ansy = N

for i in range(x+1):
    if i+1 > N:
        break
    for j in range(y+1):
        if j+1 > x+1:
            break
        if i*j == N:
            if ansx + ansy >i+j:
                ansx,ansy = i,j

print(ansx-1 + ansy -1)

Fixed submission:
N = int(input())
x = N
y = N
ansx = N
ansy = N
ans = []
n = int(N**0.5)
if N**0.5 == int(N**0.5):
    print(int(N**0.5)*2-2)
else:
    for i in range(n+1):
        if N%(i+1) == 0:
            ans.append(i+1)
    ans.append(N)
    if(ans[1]==N):
        print(N-1)
    else:
        for i in range(len(ans)):
            if ansx+ansy>ans[i] + int(N//ans[i]):
                ansx = ans[i]
                ansy =int(N//ans[i])
        print(ansx + ansy -2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = int(input())
count == 0
for i in range(N):
    if S[i+1] != S[i]:
        count += 1

print(count)

Fixed submission:
N = int(input())
S = list(input())
#print(S)
count = 1
for i in range(N):
    if i == 0:
        continue
    elif S[i-1] != S[i]:
        count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())

if r-l >= 2019:
    ans = 0
else:
    ans = 2018
    for i in range(r-1):
        for j in range(i+1,r-l+1):
            mod = ((l+i)*(l+j))%2019
            if ans > mod:
                ans = mod

print(ans)

Fixed submission:
l,r = map(int,input().split())

if r-l >= 2019:
    ans = 0
else:
    ans = 2018
    for i in range(r-l):
        for j in range(i+1,r-l+1):
            mod = ((l+i)*(l+j))%2019
            if ans > mod:
                ans = mod

print(ans)
Buggy python submission (verdict: Runtime Error):
w,h,x,y = map(int,input().split())

print(w*h/2,end = ' ')
if w/2==x and h/2==y:
    pirnt('1')
else:
    print('0')

Fixed submission:
w,h,x,y = map(int,input().split())

print(w*h/2,end = ' ')
if w/2==x and h/2==y:
    print('1')
else:
    print('0')
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(int(input())for i in range(m))
mod = 10**9+7
b = [0] * (n-1)
b[0] = 1
b[1] = 1
for i in a:
    b[i] = -1

for i in range(2,n+1):
    if b[i] == -1:
        continue
    if b[i-1] != -1:
        b[i] += b[i-1]
    if b[i-2] != -1:
        b[i] += b[i-2]

print(b[-1]%mod)

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7
b=[0]*(n+1)
b[0]=1
b[1]=1

for i in a:
    b[i]=-1

for i in range(2,n+1):
    if b[i]==-1:
        continue
    if b[i-1]!=-1:
        b[i]+=b[i-1]
    if b[i-2]!=-1:
        b[i]+=b[i-2]
        
print(b[-1]%mod)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(int(input())for i in range(M))
mod = 10**9+7
b = [0] * (n-1)
b[0] = 1
b[1] = 1
for i in a:
    b[i] = -1

for i in range(2,n+1):
    if b[i] == -1:
        continue
    if b[i-1] != -1:
        b[i] += b[i-1]
    if b[i-2] != -1:
        b[i] += b[i-2]

print(b[-1]%mod)

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7
b=[0]*(n+1)
b[0]=1
b[1]=1

for i in a:
    b[i]=-1

for i in range(2,n+1):
    if b[i]==-1:
        continue
    if b[i-1]!=-1:
        b[i]+=b[i-1]
    if b[i-2]!=-1:
        b[i]+=b[i-2]
        
print(b[-1]%mod)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = list(int(input())for i in range(M))
mod = 10**9+7
b = [0] * (n-1)
b[0] = 1
b[1] = 1
for i in a:
    b[i] = -1

for i in range(2,n+1):
    if b[i] == -1:
        continue
    if b[i-1] != -1:
        b[i] += b[i-1]
    if b[i-2] != -1:
        b[i] += b[i-2]

print(b[-1]%mod)

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7
b=[0]*(n+1)
b[0]=1
b[1]=1

for i in a:
    b[i]=-1

for i in range(2,n+1):
    if b[i]==-1:
        continue
    if b[i-1]!=-1:
        b[i]+=b[i-1]
    if b[i-2]!=-1:
        b[i]+=b[i-2]
        
print(b[-1]%mod)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m = map(int,input().split())
k_and_s = list(list(map(int,input().split()))for i in range(m))
p = list(map(int,input().split()))
k = []
s = []
p1 = np.array(p)
print("p1 = ",p1,"\n")
for i in range(m):
    k.append(k_and_s[i][0:1][0])
    s.append(k_and_s[i][1:])
switch = np.array([[0 for i in range(m)]for i in range(n)])
for i in range(len(s)):
    for j in range(len(s[i])):
        switch[s[i][j]-1][i] = 1
ans = 0
for s in range(1<<n):
    t = 0
    for i in range(n):
        if s>>i & 1 == 0:
            t ^= switch[i]
            print("t = ",t,"\n")
            if t == p1:
                ans +=1
            
print("\nswitch = ",switch,"\n")
print("m = ",m)
print("n = ",n)
print("k and s = ",k_and_s)
print("k = ",k)
print("s = ",s)
print("p = ",p1)
#print(len(s))
print(ans)

Fixed submission:
n,m = map(int,input().split())
k_and_s = list(list(map(int,input().split()))for i in range(m))
p = list(map(int,input().split()))

k = []
s = []
switch = list([[0 for i in range(m)]for i in range(n)])
switch_1 = [0 for i in range(n)]
cnt = 0

for i in range(1,len(p)+1):
    if p[i-1] == 1:
        cnt += 2**(m-i)
    if i == m:
        p_1 = cnt

for i in range(m):
    k.append(k_and_s[i][0:1][0])
    s.append(k_and_s[i][1:])

for i in range(len(s)):
    for j in range(len(s[i])):
        switch[s[i][j]-1][i] = 1

for i in range(len(switch)):
    cnt = 0
    for j in range(1,len(switch[i])+1):
        if switch[i][j-1] == 1:
            cnt += 2**(m-j)
        if j == m:
            switch_1[i] = cnt

ans = 0
for i in range(1<<n):
    t = 0
    for j in range(n):
        if i >> j & 1 != 0:
            t ^= switch_1[j]
    if t==p_1:
        ans +=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
k1 = list(list(map(int,input().split()))for i in range(m))
p = map(int,input().split())
s = list(k1[i][1:]for i in range(m))
ans = 0

for i in range(2**n):
    on = True
    for j in range(m):
        on = bin(s[j]&i)lcount('1')%2 == p[j]
        if not on:
            break
    ans += on
print(ans)

Fixed submission:
n,m = map(int,input().split())
k_and_s = list(list(map(int,input().split()))for i in range(m))
p = list(map(int,input().split()))

k = []
s = []
switch = list([[0 for i in range(m)]for i in range(n)])
switch_1 = [0 for i in range(n)]
cnt = 0

for i in range(1,len(p)+1):
    if p[i-1] == 1:
        cnt += 2**(m-i)
    if i == m:
        p_1 = cnt

for i in range(m):
    k.append(k_and_s[i][0:1][0])
    s.append(k_and_s[i][1:])

for i in range(len(s)):
    for j in range(len(s[i])):
        switch[s[i][j]-1][i] = 1

for i in range(len(switch)):
    cnt = 0
    for j in range(1,len(switch[i])+1):
        if switch[i][j-1] == 1:
            cnt += 2**(m-j)
        if j == m:
            switch_1[i] = cnt

ans = 0
for i in range(1<<n):
    t = 0
    for j in range(n):
        if i >> j & 1 != 0:
            t ^= switch_1[j]
    if t==p_1:
        ans +=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())

P = [0] * N
for i in range(Q):
    tmp = int(input()) - 1
    P[tmp] += 1

for n in range(N):
    ans = 'No'
    total = sum(P) - P[n]
    if  K - total > 0:
        ans = 'Yes'
    print(ans)


Fixed submission:
N, K, Q = map(int, input().split())

P = [0] * N
for i in range(Q):
    tmp = int(input()) - 1
    P[tmp] += 1

sumP = sum(P)
for n in range(N):
    ans = 'No'
    total = sumP - P[n]
    if  K - total > 0:
        ans = 'Yes'
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = {}

P = [K] * N
for i in range(Q):
    tmp = int(input()) - 1
    for j in range(N):
        if j != tmp:
            P[j] -= 1
for n in range(N):
    ans = 'Yes'
    if P[n] <= 0:
        ans = 'No'
    print(ans)

Fixed submission:
N, K, Q = map(int, input().split())

P = [0] * N
for i in range(Q):
    tmp = int(input()) - 1
    P[tmp] += 1

sumP = sum(P)
for n in range(N):
    ans = 'No'
    total = sumP - P[n]
    if  K - total > 0:
        ans = 'Yes'
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

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

a_dic = {}
for i, a in enumerate(A):
    a_dic[i] = a

for m in range(M):
    max_a = max(a_dic, key=a_dic.get)
    a_dic[max_a] = a_dic[max_a] // 2

ans = sum(a_dic.values())
if ans < 0:
    ans = 0
print(ans)


Fixed submission:
import time
import sys
import heapq

input = sys.stdin.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))
start = time.time()
ans = []
for a in A:
    heapq.heappush(ans, -a)

for _ in range(M):
    l = heapq.heappop(ans)
    heapq.heappush(ans, -((-l)//2) )

print(-sum(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

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

np_A = np.array(A)
for m in range(M):
    tmp = np_A.argmax()
    np_A[tmp] = np_A[tmp] / 2

print(sum(np_A))

Fixed submission:
import time
import sys
import heapq

input = sys.stdin.readline

N, M = map(int, input().split())
A = list(map(int, input().split()))
start = time.time()
ans = []
for a in A:
    heapq.heappush(ans, -a)

for _ in range(M):
    l = heapq.heappop(ans)
    heapq.heappush(ans, -((-l)//2) )

print(-sum(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = ['']*N
ans = 0
for i in range(N):
    s[i] = sorted(input())
    if i != 0:
        for j in range(i):
#            print(i, j)
            if s[i] == s[j]:
                ans += 1
print(ans)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

ans = 0
d = {}
for i in s:
    if i in d:
        ans += d[i]
        d[i] += 1
    else:
        d[i] = 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = ['']*N
ans = 0
for i in range(N):
    s[i] = ''.join(sorted(input()))
    if i != 0:
        for j in range(i):
#            print(i, j)
            if s[i] == s[j]:
                ans += 1
print(ans)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

ans = 0
d = {}
for i in s:
    if i in d:
        ans += d[i]
        d[i] += 1
    else:
        d[i] = 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = []
ans = 0
for i in range(N):
    s.append(''.join(sorted(input())))
    if i != 0:
        for j in range(i):
            if s[i] == s[j]:
                ans += 1
print(ans)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

ans = 0
d = {}
for i in s:
    if i in d:
        ans += d[i]
        d[i] += 1
    else:
        d[i] = 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = []
for i in range(N):
    s.append(''.join(sorted(input())))

ans = 0
for i in range(N):
    for j in range(i+1, N):
        if s[i] == s[j]:
            ans += 1
print(ans)


Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for i in range(N)]

ans = 0
d = {}
for i in s:
    if i in d:
        ans += d[i]
        d[i] += 1
    else:
        d[i] = 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A=[0]*N
B=[0]*N
for i in range(N):
    A[i], B[i] = map(int, input().split())

dy = 0
ans = 0
total_dy = 0
cnt = 0
while total_dy <= M:
    tmp_max = max(B)
    idxs = [i for i, x in enumerate(B) if x == max(B)]
    if len(idxs) > 1:
        for i in idxs:
            if cnt == 0:
                tmp_max_idx = i
                cnt += 1
            elif cnt > 0 and A[tmp_max_idx] < A[i]:
                tmp_max_idx = i
    else:
        tmp_max_idx = B.index(max(B))

    cnt = 0
    if A[tmp_max_idx]+dy <= M:
        ans += tmp_max
        total_dy = A[tmp_max_idx] + dy
        dy += 1

    A.pop(tmp_max_idx)
    B.pop(tmp_max_idx)
    tmp_max_idx = 0
    if A == [] or B ==[]:
        break

print(ans)

Fixed submission:
from operator import itemgetter
import heapq

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

AB.sort(key=itemgetter(0))
q = []
idx = 0
ans = 0

for i in range(1, M+1):
    while idx < N:
        a, b = AB[idx]
        if a <= i:
            heapq.heappush(q, -b)
            idx += 1
        else:
            break
    if len(q)>0:
        b = heapq.heappop(q)
        ans -= b
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A=[0]*N
B=[0]*N
for i in range(N):
    A[i], B[i] = map(int, input().split())

dy = 0
ans = 0
total_dy = 0
cnt = 0
while total_dy <= M:
    for i, x in enumerate(B):
        if x == max(B):
            if cnt == 0:
                tmp_max_idx = i
                cnt += 1
            elif cnt > 0 and A[tmp_max_idx] < A[i]:
                tmp_max_idx = i
    cnt = 0
    tmp_max = max(B)
    if A[tmp_max_idx]+dy <= M:
        ans += tmp_max
        total_dy = A[tmp_max_idx] + dy
        dy += 1

    A.pop(tmp_max_idx)
    B.pop(tmp_max_idx)
    tmp_max_idx = 0
    if A == [] or B ==[]:
        break

print(ans)

Fixed submission:
from operator import itemgetter
import heapq

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

AB.sort(key=itemgetter(0))
q = []
idx = 0
ans = 0

for i in range(1, M+1):
    while idx < N:
        a, b = AB[idx]
        if a <= i:
            heapq.heappush(q, -b)
            idx += 1
        else:
            break
    if len(q)>0:
        b = heapq.heappop(q)
        ans -= b
print(ans)
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())
for i in range(L, R+1):
    f = False
    for j in range(i+1, R+1):
        m = (i*j)%2019
        if  m  == 0:
            print(0)
            f = True
            break     
        ans = min(ans, m)
    if f:
        break
print(ans)

Fixed submission:
L, R = map(int, input().split())

ans = 2018
R = min(R, L+2020)
for i in range(L, R+1):
    f = False
    for j in range(i+1, R+1):
        m = (i*j)%2019
        if  m  == 0:
            ans = m
            f = True
            break     
        ans = min(ans, m)
    if f:
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = [int(i) for i in input().split()] 
ans = np.array(a)

s = (n,n)
M = np.matrix(np.zeros(s))
for i in range(n):
    vec = np.zeros(n)
    vec[i]=1/2
    if i == (n-1):
        vec[0]=1/2
    else:
        vec[i+1]=1/2
    M[i] = vec
ans = (np.linalg.inv(M)*(ans.reshape(-1,1)))
print(' '.join(map(str, ans.T.tolist()[0])))

Fixed submission:
import numpy as np

n = int(input())
a = [int(i) for i in input().split()] 
a = np.array(a)
x = np.zeros(n)

x[0] = sum(a) - (2*(sum(a[1::2])))

for i in range(n-1):
    x[i+1] = 2*a[i] - x[i]

print(' '.join(map(str, map(int, x))))

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = [int(i) for i in input().split()] 
ans = np.array(a)
x = np.zeros(n)

s = (n,n)
M = np.matrix(np.zeros(s))
for i in range(n):
    vec = np.zeros(n)
    vec[i]=1/2
    if i == (n-1):
        vec[0]=1/2
    else:
        vec[i+1]=1/2
    M[i] = vec
ans = (np.linalg.inv(M)*(ans.reshape(-1,1)))
print(' '.join(map(str, map(int, ans.T.tolist()[0]))))

Fixed submission:
import numpy as np

n = int(input())
a = [int(i) for i in input().split()] 
a = np.array(a)
x = np.zeros(n)

x[0] = sum(a) - (2*(sum(a[1::2])))

for i in range(n-1):
    x[i+1] = 2*a[i] - x[i]

print(' '.join(map(str, map(int, x))))
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())

ans = 2019
for i in range(L, R):
    f = False
    for j in range(i, R):
        if  ((i*j) % 2019) == 0:
            print(0)
            break
        ans = min(ans, (i*j)%2019)
    if f:
        break
print(ans)

Fixed submission:
A, B, C, D = map(int, input().split())
ans=0

def gcd(m, n):
    x=max(m, n)
    y=min(m, n)
    if x%y == 0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        else:
            return z

def lcm(x, y):
    return (x * y) // gcd(x, y)

lcmCD=lcm(C, D)
ans=B-A+1
ans-=((B//C) - ((A-1)//C))
ans-=((B//D) - ((A-1)//D))
ans+=((B//lcmCD) - ((A-1)//lcmCD))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math

A, B, C, D = map(int, input().split())
ans=0

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

lcmCD=lcm(C, D)
ans=B-A+1
ans-=((B//C) - (A//C))
ans-=((B//D) - (A//D))
ans+=((B//lcmCD) - (A//lcmCD))
print(ans)


Fixed submission:
A, B, C, D = map(int, input().split())
ans=0

def gcd(m, n):
    x=max(m, n)
    y=min(m, n)
    if x%y == 0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        else:
            return z

def lcm(x, y):
    return (x * y) // gcd(x, y)

lcmCD=lcm(C, D)
ans=B-A+1
ans-=((B//C) - ((A-1)//C))
ans-=((B//D) - ((A-1)//D))
ans+=((B//lcmCD) - ((A-1)//lcmCD))
print(ans)
Buggy python submission (verdict: Runtime Error):
, x = map(int, input().split())
l = [int(i) for i in input().split()] 

d = 0
i = 0
if x > 0:
    while d <= x:
        d = d + l[i]
        i = i + 1
        if i >= n:
            i = i + 1
            break
    print(i)
elif x <= 0:
    print(1)

Fixed submission:
n, x = map(int, input().split())
l = [int(i) for i in input().split()] 

d = 0
i = 0
if x > 0:
    while d <= x:
        d = d + l[i]
        i = i + 1
        if i >= n:
            break
    if d > x:
        print(i)
    elif d <= x:
        print(n+1)
elif x <= 0:
    print(1)

Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [int(i) for i in input().split()] 

d = 0
i = 0
if x > 0:
    while d <= x:
        d = d + l[i]
        i = i + 1
    print(i)
elif x <= 0:
    print(1)

Fixed submission:
n, x = map(int, input().split())
l = [int(i) for i in input().split()] 

d = 0
i = 0
if x > 0:
    while d <= x:
        d = d + l[i]
        i = i + 1
        if i >= n:
            break
    if d > x:
        print(i)
    elif d <= x:
        print(n+1)
elif x <= 0:
    print(1)

Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = [int(i) for i in input().split()] 

d = 0
if x > 0:
    for i in range(n):
        d = d + l[i]
        print(i, l[i])
        if d > x:
            break
    print(i+1)
elif x <= 0:
    print(1)
'''

Fixed submission:
n, x = map(int, input().split())
l = [int(i) for i in input().split()] 

d = 0
i = 0
if x > 0:
    while d <= x:
        d = d + l[i]
        i = i + 1
        if i >= n:
            break
    if d > x:
        print(i)
    elif d <= x:
        print(n+1)
elif x <= 0:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, M = map(int, input().split())

cards = np.zeros(N) 
for j in range(M):
    L, R = map(int, input().split())
    for i in range(1, N+1):
        if cards[i-1] != 1:
            if L > i or R < i:
                cards[i-1] = 1

print(int(len(cards)-np.sum(cards)) )

Fixed submission:
import numpy as np
N, M = map(int, input().split())

L = np.zeros(M)
R = np.zeros(M)
for j in range(M):
    L[j], R[j] = map(int, input().split())

if int(min(R) - max(L) + 1) < 0:
    print(0)
else:
    print(int(min(R) - max(L) + 1))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, M = map(int, input().split())

cards = np.zeros(N) 
for j in range(M):
    L, R = map(int, input().split())
    for i in range(1, N+1):
        if L > i or R < i:
            cards[i-1] = 1

print(int(len(cards)-np.sum(cards)) )

Fixed submission:
import numpy as np
N, M = map(int, input().split())

L = np.zeros(M)
R = np.zeros(M)
for j in range(M):
    L[j], R[j] = map(int, input().split())

if int(min(R) - max(L) + 1) < 0:
    print(0)
else:
    print(int(min(R) - max(L) + 1))
Buggy python submission (verdict: Runtime Error):
s = input()
acgt='ACGT'

x = 0; l=[]
for c in s:
    if c in acgt:
        x += 1
    else:
        l.append(x)
        x = 0
print(max(l))

Fixed submission:
s = input()
acgt='ACGT'

x = 0; l=[]
for c in s:
    if c in acgt:
        x += 1
    else:
        l.append(x)
        x = 0
l.append(x)
print(max(l))
Buggy python submission (verdict: Runtime Error):
import sys

stdin = sys.stdin

na = lambda: list(map(int, ns().split()))
ns = lambda: stdin.readline()

N, Y = na()

ans="-1 -1 -1"
for i in range(N+1, -1, -1):
    if (i * 10000) > Y:
        continue
    for j in range(N+1-i):
        k = n - i - j
        if ((i * 10000) + (j * 5000)) > Y:
            continue
        if (i*10000) + (j*5000) + (k*1000) == Y:
            ans = str(i) + " " + str(j) + " " + str(k)
            break
    else:
        continue
    break

print(ans)


Fixed submission:
import sys

stdin = sys.stdin

na = lambda: list(map(int, ns().split()))
ns = lambda: stdin.readline()

N, Y = na()

ans="-1 -1 -1"
for i in range(N+1):
    if (i * 10000) > Y:
        continue
    for j in range(N+1-i):
        k = N - i - j
        if ((i * 10000) + (j * 5000)) > Y:
            continue
        if (i*10000) + (j*5000) + (k*1000) == Y:
            ans = str(i) + " " + str(j) + " " + str(k)
            break
    else:
        continue
    break

print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

if (1 <= A <= 9) and (1 <= B <= 9):
  return A * B
else: return -1

Fixed submission:
A, B = map(int, input().split())

if (1 <= A <= 9) and (1 <= B <= 9):
  print( A * B )
else: print( -1 )
Buggy python submission (verdict: Runtime Error):
from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter
from math import gcd
import bisect
ii = lambda: int(input())
iia = lambda: list(map(int,input().split()))
isa = lambda: list(input().split())

a,b = iia()

print(int((a*b)/gcd(a,b)))

Fixed submission:
import math
from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter
import bisect
ii = lambda: int(input())
iia = lambda: list(map(int,input().split()))
isa = lambda: list(input().split())

a = ii()
b = ii()

print(6-a-b)