Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    t=factorization(a[i])
    if t[0][0]==2:
        ans+=t[0][1]
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    while a[i]%2==0:
        ans+=1
        a[i]/=2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    t=factorization(a[i])
    for j,k in t:
        if j==2:
            ans+=k
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    while a[i]%2==0:
        ans+=1
        a[i]/=2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,C=map(int,input().split())
d=[]
c=[]
ans=float("inf")
for i in range(C):
    d.append(list(map(int,input().split())))
for i in range(n):
    c.append(list(map(int,input().split())))
for i in range(1,C+1):
    for j in range(1,C+1):
        if i==j:
            continue
        for k in range(1,C+1):
            if k==i or k==j:
                continue
            t=0
            for ii in range(n):
                for jj in range(n):
                    z=(ii+jj+2)%3
                    if z==0:
                        t+=d[c[ii][jj]-1][i-1]
                    elif z==1:
                        t+=d[c[ii][jj]-1][j-1]
                    elif z==2:
                        t+=d[c[ii][jj]-1][k-1]
            if t<ans:
                ans=t
print(ans)

Fixed submission:
N,C = map(int,input().split())
d = [list(map(int,input().split())) for _ in range(C)]
g0 = [0]*C
g1 = [0]*C
g2 = [0]*C
for i in range(N):
    col = list(map(int,input().split()))
    for j in range(N):
        col[j] -= 1
        if (i+j)%3==0:
            g0[col[j]] += 1
        elif (i+j)%3 ==1:
            g1[col[j]] += 1
        else:
            g2[col[j]] += 1
ans = float('inf')
for i in range(C):
    for j in range(C): 
        for k in range(C):
            if i==j or j==k or i==k:
                continue
            s=0
            for l in range(C):
                s += d[l][i]*g0[l] + d[l][j]*g1[l] + d[l][k]*g2[l]
            ans = min(ans,s)
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(1,min(t,n-l)):
        ans.add(s[l:r])
aa=list(ans)
aa.sort()
print(aa[t-1])

Fixed submission:
s = input()
l = len(s)
k = int(input())
A = set()
for i in range(l):
    for j in range(1, 6):
        if i+j <= l:
            A.add(s[i:i+j])
ANS = sorted(A)
print(ANS[k-1])

Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(l+1,n+1):
        ans.add(s[l:min(l+t,r)])
aa=list(ans)
aa.sort()
print(aa[t-1])

Fixed submission:
s = input()
l = len(s)
k = int(input())
A = set()
for i in range(l):
    for j in range(1, 6):
        if i+j <= l:
            A.add(s[i:i+j])
ANS = sorted(A)
print(ANS[k-1])

Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(l+1,n+1):
        ans.add(s[l:min(l+k,r)])
aa=list(ans)
aa.sort()
print(aa[t-1])

Fixed submission:
s = input()
l = len(s)
k = int(input())
A = set()
for i in range(l):
    for j in range(1, 6):
        if i+j <= l:
            A.add(s[i:i+j])
ANS = sorted(A)
print(ANS[k-1])

Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
t=int(input())
if t==1:
    print(s)
    exit()
ans=set()
for l in range(n-1):
    for r in range(l+1,n+1):
        ans.add(s[l:r])
aa=list(ans)
aa.sort()
print(aa[t-1])

Fixed submission:
s = input()
l = len(s)
k = int(input())
A = set()
for i in range(l):
    for j in range(1, 6):
        if i+j <= l:
            A.add(s[i:i+j])
ANS = sorted(A)
print(ANS[k-1])
Buggy python submission (verdict: Runtime Error):
import sys
h,w=map(int,input().split())
maze=[]
for i in range(w):
    maze.append(list(input()))
for i in range(w):
    for j in range(h):
        if maze[i][j]=="#":
            flg=False
            for l,m in [(0,1),(1,0),(-1,0),(0,-1)]:
                if 0<=i+l<w and 0<=j+m<h and maze[i+l][j+m]=="#":
                    flg=True
            if flg==False:
                print("No")
                sys.exit()
print("Yes")

Fixed submission:
import sys
h,w=map(int,input().split())
maze=[]
for i in range(h):
    maze.append(list(input()))
for i in range(h):
    for j in range(w):
        if maze[i][j]=="#":
            flg=False
            for l,m in [(0,1),(1,0),(-1,0),(0,-1)]:
                if 0<=i+l<h and 0<=j+m<w:
                    if maze[i+l][j+m]=="#":
                        flg=True
            if flg==False:
                print("No")
                sys.exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
import sys
h,w=map(int,input().split())
maze=[]
for i in range(w):
    maze.append(list(input()))
for i in range(w):
    for j in range(h):
        if maze[i][j]=="#":
            flg=False
            for l,m in [(0,1),(1,0),(-1,0),(0,-1)]:
                if 0<=i+l<w and 0<=j+m<h:
                    if maze[i+l][j+m]=="#":
                        flg=True
            if flg==False:
                print("No")
                sys.exit()
print("Yes")

Fixed submission:
import sys
h,w=map(int,input().split())
maze=[]
for i in range(h):
    maze.append(list(input()))
for i in range(h):
    for j in range(w):
        if maze[i][j]=="#":
            flg=False
            for l,m in [(0,1),(1,0),(-1,0),(0,-1)]:
                if 0<=i+l<h and 0<=j+m<w:
                    if maze[i+l][j+m]=="#":
                        flg=True
            if flg==False:
                print("No")
                sys.exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split()))
a.sort()
ans=0
while True:
    if a[0]==a[1]==a[2]:
        print(ans)
        sys.exit()
    if a[0]<a[1]:
        a[0]+=2
        ans+=1
        a.sort()
        if a[0]==a[1]==a[2]:
            print(ans)
            sys.exit()
    if a[0]==a[1]:
        a[0]+=1
        a[1]+=1
        ans+=1
        a.sort()
        if a[0]==a[1]==a[2]:
            print(ans)
            sys.exit()

Fixed submission:
import sys
a=list(map(int,input().split()))
a.sort()
ans=0
while True:
    if a[0]==a[1]==a[2]:
        print(ans)
        sys.exit()
    if a[0]<a[1]:
        a[0]+=2
        ans+=1
        a.sort()
        if a[0]==a[1]==a[2]:
            print(ans)
            sys.exit()
    if a[0]==a[1]:
        a[0]+=1
        a[1]+=1
        ans+=1
        a.sort()
        if a[0]==a[1]==a[2]:
            print(ans)
            sys.exit()
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
b=[i for i in range(k+1,n+1)]
ans=0
if k==0:
    for i in range(len(b)):
    t=b[i]
    j=t-k
    ii=n//t
    ans+=ii*j
    ans+=max(n-ii*t-k,0)
    print(ans)
    exit()
for i in range(len(b)):
    t=b[i]
    j=t-k
    ii=n//t
    ans+=ii*j
    ans+=max(n-ii*t-k+1,0)
print(ans)

Fixed submission:
n,k=map(int,input().split())
b=[i for i in range(k+1,n+1)]
ans=0
if k==0:
    for i in range(len(b)):
        t=b[i]
        j=t-k
        ii=n//t
        ans+=ii*j
        ans+=max(n-ii*t-k,0)
    print(ans)
    exit()
for i in range(len(b)):
    t=b[i]
    j=t-k
    ii=n//t
    ans+=ii*j
    ans+=max(n-ii*t-k+1,0)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split()),reverse=True)
print(sum(a[::2])-sum(a[1::2]))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a,reverse=True)
alice=sum(b[::2])
Bob=sum(b[1::2])
print(alice-Bob)
Buggy python submission (verdict: Runtime Error):
a,b=int(input().replace(" ",""))
flg=False
i=0
while i**2<=ab:
    if i**2==ab:
        flg=True
        break
    i+=1

print("Yes" if flg else "No")

Fixed submission:
ab=int(input().replace(" ",""))
flg=False
i=0
while i**2<=ab:
    if i**2==ab:
        flg=True
        break
    i+=1

print("Yes" if flg else "No")
Buggy python submission (verdict: Runtime Error):
import sys
n,y=map(int,input().split())
if n*10000<y:
    print("-1 -1 -1")
    sys.exit()
if y//1000<n:
    print("-1 -1 -1")
    sys.exit()
m=y//10000
g=(y-m*10000)//5000
k=(y-10000*i-5000*j)//1000
for i in range(m+1):
    for j in range(g+1):
        for s in range(k+1):
            s=(y-10000*i-5000*j)//1000
            if i+j+s==n and s>=0:
                print(i,j,s)
                sys.exit()
print("-1 -1 -1")

Fixed submission:
import sys
n,y=map(int,input().split())
if n*10000<y:
    print("-1 -1 -1")
    sys.exit()
if y//1000<n:
    print("-1 -1 -1")
    sys.exit()
m=y//10000
for i in range(m+1):
    g=(y-i*10000)//5000
    for j in range(g+1):
        s=(y-10000*i-5000*j)//1000
        if i+j+s==n and s>=0:
            print(i,j,s)
            sys.exit()
print("-1 -1 -1")

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,y=map(int,input().split())
if n*10000<y:
    print("-1 -1 -1")
    sys.exit()
if y//1000<n:
    print("-1 -1 -1")
    sys.exit()
m=y//10000
g=y//5000
for i in range(m+1):
    for j in range(g+1):
        s=(y-10000*i-5000*j)//1000
        if i+j+s==n and s>=0:
            print(i,j,s)
            sys.exit()
print("-1 -1 -1")

Fixed submission:
import sys
n,y=map(int,input().split())
if n*10000<y:
    print("-1 -1 -1")
    sys.exit()
if y//1000<n:
    print("-1 -1 -1")
    sys.exit()
m=y//10000
for i in range(m+1):
    g=(y-i*10000)//5000
    for j in range(g+1):
        s=(y-10000*i-5000*j)//1000
        if i+j+s==n and s>=0:
            print(i,j,s)
            sys.exit()
print("-1 -1 -1")
Buggy python submission (verdict: Time Limit Exceeded):
q=int(input())
for i in range(q):   
    l,r=map(int,input().split())
    ans=0
    for j in range(l,r+1,2):
        k=(j+1)//2
        if j==1:
            continue
        if k==2:
            ans+=1
            continue
        flg=True
        for h in range(2,int(j**(1/2))+1):
            if j%h==0:
                flg=False
        for s in range(2,int(k**(1/2))+1):
            if k%s==0:
                flg=False
        if flg:
            ans+=1
    print(ans)

Fixed submission:
import sys

Q = int(sys.stdin.readline().strip())
LR = []
for i in range(Q):
    LR.append([int(x) for x in sys.stdin.readline().strip().split()])

N = 10**5+1
Primes = list(range(N+1))
Primes[1] = 0

for p in Primes:
    if p * p > N+1: break
    if p == 0: continue
    for i in range(p + p, N+1, p):
        Primes[i] = 0

primes = [p for p in Primes if p > 0]

likes = []
r = 0
for n in range(N):
    if n%2 == 1 and Primes[n] > 0 and Primes[n//2+1] > 0:
        r += 1
    likes.append(r)

for i in range(Q):
    print(likes[LR[i][1]] - likes[LR[i][0]-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(100001)]
ans=0
for i in range(n):
    l[a[i]]+=1
for i in range(100001):
    if 0<l[i]<i:
        ans+=l[i]
    if i<l[i]:
        t=l[i]-i
        ans+=t
print(ans)        

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(10**5+1)]
ans=0
for i in range(n):
    if a[i]>10**5:
        ans+=1
    else:
        l[a[i]]+=1
for i in range(10**5+1):
    if 0<l[i]<i:
        ans+=l[i]
    if i<l[i]:
        t=l[i]-i
        ans+=t
print(ans)
Buggy python submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, n):
        self.nodes=n
        self.parents = [i for i in range(n)]
        self.sizes = [1] * n
        self.rank = [0] * n

    def find(self, i):
        if self.parents[i] == i:
            return i
        else:
            self.parents[i] = self.find(self.parents[i]) # 経路圧縮
            return self.parents[i]

    def unite(self, i, j):
        pi = self.find(i)
        pj = self.find(j)
        if pi != pj:
            if self.rank[pi] < self.rank[pj]:
                self.sizes[pj] += self.sizes[pi]
                self.parents[pi] = pj
            else:
                self.sizes[pi] += self.sizes[pj]
                self.parents[pj] = pi
                if self.rank[pi] == self.rank[pj]:
                    self.rank[pi] += 1
    def same(self, i, j):
        return self.find(i)==self.find(j)
    def get_parents(self):
        for n in range(self.nodes):
            selff.find(n)
        return self.parents

adj=[]
n, m = map(int,input().split())
for i in range(m):
    uf = UnionFind(n)
    for j in range(m):
        if i==j:
            continue
        uf.unite(adj[j])
    if len(set(uf.get_parents()))!=1:
        ans+=1
print(ans)

Fixed submission:
class UnionFind:
    def __init__(self, n):
        self.nodes = n
        self.parents = [i for i in range(n)]
        self.sizes = [1] * n
        self.rank = [0] * n

    def find(self, i): # どの集合に属しているか（根ノードの番号）
        if self.parents[i] == i:
            return i
        else:
            self.parents[i] = self.find(self.parents[i]) # 経路圧縮
            return self.parents[i]

    def unite(self, i, j): # 二つの集合を併合
        pi = self.find(i)
        pj = self.find(j)
        if pi != pj:
            if self.rank[pi] < self.rank[pj]:
                self.sizes[pj] += self.sizes[pi]
                self.parents[pi] = pj
            else:
                self.sizes[pi] += self.sizes[pj]
                self.parents[pj] = pi
                if self.rank[pi] == self.rank[pj]:
                    self.rank[pi] += 1
    def same(self, i, j): # 同じ集合に属するかを判定
        return self.find(i)==self.find(j)

    def get_parents(self): # 根ノードの一覧を取得
        for n in range(self.nodes): # findで経路圧縮する
            self.find(n)
        return self.parents

adj = []
N, M = map(int,input().split())
for m in range(M):
    a,b = map(int,input().split())
    adj.append([a-1,b-1])

ans = 0
for i in range(M): # 取り除く辺番号
    uf = UnionFind(N)
    for j in range(M):
        if (i==j): # 辺を追加しない（取り除く）
            continue
        uf.unite(*adj[j])
    
    if len(set(uf.get_parents()))!=1: # 複数の集合にわかれているか確認
        ans += 1
print (ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
a=100*a
b=100*b
dp1=[0]*(f+1)
dp2=[0]*(f+1)
for i in range(f+1):
    if i%a==0:
        if i+a<=f:
            dp1[i+a]=1
for i in range(f+1):
    if i==0 or dp1[i]==1:
        if i+b<=f:
            dp1[i+b]=1
for i in range(f+1):
    if i%c==0:
        if i+c<=f:
            dp2[i+c]=1
for i in range(f+1):
    if i==0 or dp2[i]==1:
        if i+d<=f:
            dp2[i+d]=1

ans=[-1,-1,-1]
for i in range(f+1):
    if dp1[i]==1:
        x=min(f-i,(i//100)*e)
        k=-1
        for j in range(x,-1,-1):
            if dp2[j]==1 or j==0:
                k=j
                if ans[0]<100*k/(i+k):
                    ans=[100*k/(i+k),i+k,k]
                break
print(str(ans[1])+" "+str(ans[2]))

Fixed submission:
n=int(input())
a=int(input())
print(n**2-a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A)

Fixed submission:
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Buggy python submission (verdict: Runtime Error):
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.append(a)
print(len(A))

Fixed submission:
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=[]
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.append(a)
print(len(A))

Fixed submission:
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=[]
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.append(a)
print(len(A))

Fixed submission:
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Buggy python submission (verdict: Runtime Error):
from collections import deque
n=int(input())
A=[]
for i in range(n):
    a=input()
    if a in A:
        A.append(a)
    else:
        A.remove(a)
print(len(A))

Fixed submission:
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n=int(input())
a=[int(input()) for i in range(n)]
ans=0
A=set(a)
for i in A:
    if a.count(i)%2==1:
        ans+=1
print(ans)

Fixed submission:
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n=int(input())
a=[int(input()) for i in range(n)]
A=deque(a)
tmp=[]
while A:
    if A[0] in tmp:
        tmp.remove(A.popleft())
    else:
        tmp.append(A.popleft())
print(len(tmp))

Fixed submission:
n=int(input())
A=set()
for i in range(n):
    a=input()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(1,100001):
    tmp=0
    tmp+=a.count(i-1)
    tmp+=a.count(i)
    tmp+=a.count(i+1)
    if tmp>ans:
        ans=tmp
print(ans)

Fixed submission:
n=int(input())
b=[0 for i in range(100002)]
a=list(map(int,input().split()))
a.sort()
for i in range(n):
    b[a[i]]+=1
ans=0
for i in range(1,100001):
    tmp=b[i-1]+b[i]+b[i+1]
    if tmp>ans:
        ans=tmp
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
t=list(int(input()) for i in range(n))
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//math.gcd(ans,t[i])
print(ans)

Fixed submission:
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//fractions.gcd(ans,t[i])
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
t=[int(input()) for i in range(n)]
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//math.gcd(ans,t[i])
print(ans)

Fixed submission:
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//fractions.gcd(ans,t[i])
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

n=int(input())
t=[int(input()) for i in range(n)]
print(lcm(t))

Fixed submission:
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//fractions.gcd(ans,t[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=deque()
for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
b=list(b)
if n%2==0:
    print(*b)
else:
    print(*b[::-1])

Fixed submission:
from collections import *
n=int(input())
a=list(map(int,input().split()))
b=deque()
for i in range(n):
    if i%2==0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
b=list(b)
if n%2==0:
    print(*b)
else:
    print(*b[::-1])
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=""
for i in range(n):
    a,b=map(int,input().split())
    A+=str(a)*b
print(A[k-1])

Fixed submission:
import sys
n,k=map(int,input().split())
A=[]
tmp=k
for i in range(n):
    a,b=map(int,input().split())
    A.append([a,b])
A.sort(key=lambda x:x[0])
for i in range(n):
    tmp-=A[i][1]
    if tmp<=0:
        print(A[i][0])
        sys.exit()
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
ans=0
if a%2==1 or b%2==1 or c%2==1:
    print(-1)
    sys.exit()
if a%2==0 and a==b==c:
    print(-1)
    sys.exit()
while a%2==0 and b%2==0 and c%2==0:
    ta=a/2
    tb=b/2
    tc=c/2
    a=tb+tc
    b=ta+tc
    c=ta+tb
    ans+=1
print(ans)

Fixed submission:
import sys
a,b,c=map(int,input().split())
ans=0
if a%2==1 or b%2==1 or c%2==1:
    print(0)
    sys.exit()
if a%2==0 and a==b==c:
    print(-1)
    sys.exit()
while a%2==0 and b%2==0 and c%2==0:
    ta=a/2
    tb=b/2
    tc=c/2
    a=tb+tc
    b=ta+tc
    c=ta+tb
    ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
if n==1:
    print(1)
    sys.exit()
k=2
ans=0
while k*2<=n:
    k*=2
    ans+=1
print(k)

Fixed submission:
import sys
a,b,c=map(int,input().split())
ans=0
if a%2==1 or b%2==1 or c%2==1:
    print(0)
    sys.exit()
if a%2==0 and a==b==c:
    print(-1)
    sys.exit()
while a%2==0 and b%2==0 and c%2==0:
    ta=a/2
    tb=b/2
    tc=c/2
    a=tb+tc
    b=ta+tc
    c=ta+tb
    ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=1
for i in range(1,n+1):
    s*=i
ans=s%(10**9+7)
print(ans)

Fixed submission:
import math
n=int(input())
s=math.factorial(n)
ans=s%(10**9+7)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n=int(input())
A=deque()
B=deque()
ans=0
for i in range(n):
    a,b=map(int,input().split())
    A.appendleft(a)
    B.appendleft(b)
for i in range(n):
    if A[i]%B[i]!=0:
        k=B[i]-(A[i]%B[i])
        ans+=k
        A=list(map(lambda x:x+k,A))
print(ans)

Fixed submission:
from collections import deque
n=int(input())
A=deque()
B=deque()
ans=0
for i in range(n):
    a,b=map(int,input().split())
    A.appendleft(a)
    B.appendleft(b)
while A:
    A[0]+=ans
    if A[0]%B[0]!=0:
        k=B[0]-(A[0]%B[0])
        ans+=k
    A.popleft()
    B.popleft()

print(ans)