Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,ma,mb=map(int,input().split())
dpn=400001
dp=[10**6]*dpn
dp[0]=0
for i in range(n):
    a,b,c=map(int,input().split())
    for j in range(dpn-1,-1,-1):
        if j==0 or dp[j]!=10**6:
            dp[j+a*1000+b]=min(dp[j+a*1000+b],dp[j]+c)
ans=10**6
s=1000*ma+mb
p=1
while s*p<dpn:
    ans=min(ans,dp[s*p])
    p+=1
if ans==10**6:
    print(-1)
else:
    print(ans)


Fixed submission:
n,ma,mb=map(int,input().split())
dpn=400001
dp=[10**6]*dpn
dp[0]=0
for i in range(n):
    a,b,c=map(int,input().split())
    for j in range(dpn-1,-1,-1):
        if j==0 or dp[j]!=10**6:
            dp[j+a*1000+b]=min(dp[j+a*1000+b],dp[j]+c)
ans=10**6
s=1000*ma+mb
p=1
while s*p<dpn:
    ans=min(ans,dp[s*p])
    p+=1
if ans==10**6:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
n,ma,mb=map(int,input().split())
dpn=10**6
dp=[10**6]*dpn
dp[0]=0
for i in range(n):
    a,b,c=map(int,input().split())
    for j in range(dpn,-1,-1):
        if j==0 or dp[j]!=10**6:
            dp[j+a*1000+b]=min(dp[j+a*1000+b],dp[j]+c)
ans=10**6
s=1000*ma+mb
p=1
while s*p<10**6:
    ans=min(ans,dp[s*p])
    p+=1
print(ans)

Fixed submission:
n,ma,mb=map(int,input().split())
dpn=400001
dp=[10**6]*dpn
dp[0]=0
for i in range(n):
    a,b,c=map(int,input().split())
    for j in range(dpn-1,-1,-1):
        if j==0 or dp[j]!=10**6:
            dp[j+a*1000+b]=min(dp[j+a*1000+b],dp[j]+c)
ans=10**6
s=1000*ma+mb
p=1
while s*p<dpn:
    ans=min(ans,dp[s*p])
    p+=1
if ans==10**6:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
s=list(input())

a=0
for i in range(len(s)):
    if s[i]=='A':
        a=i
        break
b=0
for i in range(len(s)):
    if s[n-i-1]=='Z':
        b=n-i-1
        break
print(a-b+1)

Fixed submission:
s=list(input())

a=0
for i in range(len(s)):
    if s[i]=='A':
        a=i
        break
b=0
for i in range(len(s)):
    if s[len(s)-i-1]=='Z':
        b=len(s)-i-1
        break
print(b-a+1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==1:
    print(1)
    exit()
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
so=[]
ka=[]
for i in range(2,n+1):
    a=factorization(i)
    for j in a:
        if not j[0] in so:
            so.append(j[0])
            ka.append(j[1])
        else:
            ka[so.index(j[0])]+=j[1]
ans=1
for i in ka:
    ans*=(ka+1)
print(ans)

Fixed submission:
n=int(input())
if n==1:
    print(1)
    exit()
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
so=[]
ka=[]
for i in range(2,n+1):
    a=factorization(i)
    for j in a:
        if not j[0] in so:
            so.append(j[0])
            ka.append(j[1])
        else:
            ka[so.index(j[0])]+=j[1]
ans=1
for i in ka:
    ans*=(i+1)%1000000007
print(ans%1000000007)
Buggy python submission (verdict: Runtime Error):
import heapq
n,m=map(int,input().split())
g=[[] for i in range(n)]
p=[]
for i in range(m):
    a,b,c=map(int,input().split())
    a-=1
    b-=1
    p.append([a,b,c])
    g[a].append([c,b])
    g[b].append([c,a])
ans=0
for i in range(m):
    s=p[i][0]
    goal=p[i][1]
    c=p[i][2]
    q=[]
    heapq.heappush(q,[0,s])
    v=[-1]*n
    v[s]=0
    while q:
        p=heapq.heappop(q)
        if p[1]==goal:
            break
        for i in g[p[1]]:
            if v[i[1]]==-1:
                v[i[1]]=i[0]+v[p[1]]
                heapq.heappush(q,[v[i[1]],i[1]])
    if p[0]<c:
        ans+=1
print(ans)

Fixed submission:
import heapq
def dijkstra_heap(s,g):
    used = [True] * n #True:未確定
    used[s] = False
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist,[e[0],e[1]])
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        if v==g:
            return minedge[0]
        kai=minedge[0]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[e[0]+kai,e[1]])                   
    return -1

################################
n,m = map(int,input().split()) #n:頂点数　w:辺の数

edge = [[] for i in range(n)]
#edge[i] : iから出る道の[重み,行先]の配列
pp=[]
for i in range(m):
    x,y,z = map(int,input().split())
    edge[x-1].append([z,y-1])
    edge[y-1].append([z,x-1])
    pp.append([x-1,y-1,z])
ans=0
for i in range(m):
    if pp[i][2]>dijkstra_heap(pp[i][0],pp[i][1]):
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

    def ans(self):
        print(len(set(self.par))-1)

n,m=map(int,input().split())
uf=UnionFind(n)
l=[[] for i in range(m)]
for i in range(n):
    k=list(map(int,input.split()))
    k=[1:]
    for j in k:
        l[j-1].append(i)
    
for i in range(m):
    if len(l[i])>0:
        ll=l[i][0]
        for j in range(len(l[i])-1):
            uf.union(ll,l[i][j+1])

for i in range(1,n+1):
    uf.find(i)

if uf.ans()==1:
    print('YES')
else:
    print('NO')


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

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

    def ans(self):
        return (len(set(self.par))-1)

n,m=map(int,input().split())
uf=UnionFind(n)
l=[[] for i in range(m)]
for i in range(n):
    k=list(map(int,input().split()))
    k=k[1:]
    for j in k:
        l[j-1].append(1+i)
    
for i in range(m):
    if len(l[i])>0:
        ll=l[i][0]
        for j in range(len(l[i])-1):
            uf.union(ll,l[i][j+1])

for i in range(1,n+1):
    uf.find(i)

if uf.ans()==1:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input())
r=[]
for i in range(h):
    r.append(list(input()))
t=[]
for i in range(h):
    for j in range(w):
        if r[i][j]=='#':
            t.append([i,j])
op=[[[0,0]]]
for i in range(h+w-2):
    tmp=[]
    for j in op:
        tmp.append(j+[[j[-1][0]+1,j[-1][1]]])
        tmp.append(j+[[j[-1][0],j[-1][1]+1]])
    op=tmp
for i in op:
    if sorted(i)==sorted(t):
        print('Possible')
        exit()
print('Impossible')

Fixed submission:
h,w=map(int,input().split())
r=[]
for i in range(h):
    r.append(list(input()))
t=[]
for i in range(h):
    for j in range(w):
        if r[i][j]=='#':
            t.append([i,j])
op=[[[0,0]]]
for i in range(h+w-2):
    tmp=[]
    for j in op:
        tmp.append(j+[[j[-1][0]+1,j[-1][1]]])
        tmp.append(j+[[j[-1][0],j[-1][1]+1]])
    op=tmp
for i in op:
    if sorted(i)==sorted(t):
        print('Possible')
        exit()
print('Impossible')
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())

if a==b+c or b==a+c or c=a+b:
    print('YES')
else:
    print('NO')

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

if a==b+c or b==a+c or c==a+b:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import bisect
n,a,b=map(int,input().split())
t=set([])
for i in range(n):
    t.add(int(input()))
t=list(t)
t.sort()
ai=bisect.bisect_left(t,a)
bi=bisect.bisect_left(t,b)
print(ans-(bi-ai))


Fixed submission:
import bisect
n,a,b=map(int,input().split())
t=set([])
for i in range(n):
    t.add(int(input()))
t=list(t)
t.sort()
ai=bisect.bisect_left(t,a)
bi=bisect.bisect_left(t,b)
print(len(t)-(bi-ai))

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
t=[]
for i in range(n):
    t.append(int(input()))
t=set(t)
ans=len(t)
for i in range(a,b):
    if i in t:
        ans-=1
print(ans)

Fixed submission:
import bisect
n,a,b=map(int,input().split())
t=set([])
for i in range(n):
    t.add(int(input()))
t=list(t)
t.sort()
ai=bisect.bisect_left(t,a)
bi=bisect.bisect_left(t,b)
print(len(t)-(bi-ai))
Buggy python submission (verdict: Runtime Error):
s=list(input())

print(''.join(s[0:4]+' '+''.join(s[4:])

Fixed submission:
s=list(input())

print(''.join(s[0:4])+' '+''.join(s[4:]))
Buggy python submission (verdict: Runtime Error):
s=list(input())
k=int(input())

al=list('bcdefghijklmnopqrstuvwxyza')

ans=''
for i in range(len(s)):
    d=25-al.index(s[i])
    if d<=k or s[i]=='a':
        ans+='a'
        k-=d
    else:
        ans+=s[i]
k=k%26
f=al.index(ans[-1])
ans[-1]=al[min(f+k,f+k-26)]
print(ans)

Fixed submission:
s=list(input())
k=int(input())

al=list('bcdefghijklmnopqrstuvwxyza')

ans=''
for i in range(len(s)):
    d=25-al.index(s[i])
    if d<=k or s[i]=='a':
        ans+='a'
        k-=d
    else:
        ans+=s[i]
k=k%26
f=al.index(ans[-1])
kai=list(ans)
kai.pop(-1)
ans=''.join(kai)
ans+=al[min(f+k,f+k-26)]
print(ans)
Buggy python submission (verdict: Runtime Error):
a=list(input())
b=list(input())
c=list(input())
cur='a'
while True:
    if cur=='a':
        if len(a)==0:
            print('a')
            break
        else:
            cur=a.pop()
    elif cur=='b':
        if len(b)==:
            print('b')
            break
        else:
            cur=b.pop()
    else:
        if len(c)==0:
            print('c')
            break
        else:
            cur=c.pop()
            
           
        

Fixed submission:
a=list(input())
b=list(input())
c=list(input())
cur='a'
ai=-1
bi=-1
ci=-1
while ai<len(a) and bi<len(b) and ci<len(c):
    if cur=='a':
        ai+=1
        if ai<len(a):
            cur=a[ai]
    elif cur=='b':
        bi+=1
        if bi<len(b):
            cur=b[bi]
    else:
        ci+=1
        if ci<len(c):
            cur=c[ci]
if ai==len(a):
    print('A')
elif bi==len(b):
    print('B')
else:
    print('C')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input=sys.stdin.readline
h,w,n=map(int,input().split())
z=(h-2)*(w-2)
p=[]
for i in range(n):
    x,y=map(int,input().split())
    for j in range(3):
        for k in range(3):
            p.append([x+j-1,y+k-1])
p.sort()
n=len(p)
p.append([10**20,10**20])
ans=[0]*10
f=1
for i in range(n):
    if 2<=p[i][0]<=h-1 and 2<=p[i][1]<=w-1:
        if p[i]==p[i+1]:
            f+=1
        else:
            ans[f]+=1
            f=1
ans[0]=z-sum(ans)
for i in ans:
    print(i)


Fixed submission:
import sys
input=sys.stdin.readline
h,w,n=map(int,input().split())
z=(h-2)*(w-2)
p=[]
for i in range(n):
    x,y=map(int,input().split())
    for j in range(3):
        for k in range(3):
            p.append([x+j-1,y+k-1])
p.sort(key=lambda x:(10**10)*x[0]+x[1])
n=len(p)
p.append([10**20,10**20])
ans=[0]*10
f=1
for i in range(n):
    if 2<=p[i][0]<=h-1 and 2<=p[i][1]<=w-1:
        if p[i]==p[i+1]:
            f+=1
        else:
            ans[f]+=1
            f=1
ans[0]=z-sum(ans)
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
h,w,n=map(int,input().split())
z=(h-2)*(w-2)
p=[]
for i in range(n):
    x,y=map(int,input().split())
    for j in range(3):
        for k in range(3):
            if 2<=x+j-1<=h-1 and 2<=y+k-1<=w-1: 
                p.append([x+j-1,y+k-1])
p.sort()
n=len(p)
p.append([10**20,10**20])
ans=[0]*10
f=1
for i in range(n):
    #if 2<=p[i][0]<=h-1 and 2<=p[i][1]<=w-1:
    if p[i]==p[i+1]:
        f+=1
    else:
        ans[f]+=1
        f=1
ans[0]=z-sum(ans)
for i in ans:
    print(i)


Fixed submission:
import sys
input=sys.stdin.readline
h,w,n=map(int,input().split())
z=(h-2)*(w-2)
p=[]
for i in range(n):
    x,y=map(int,input().split())
    for j in range(3):
        for k in range(3):
            p.append([x+j-1,y+k-1])
p.sort(key=lambda x:(10**10)*x[0]+x[1])
n=len(p)
p.append([10**20,10**20])
ans=[0]*10
f=1
for i in range(n):
    if 2<=p[i][0]<=h-1 and 2<=p[i][1]<=w-1:
        if p[i]==p[i+1]:
            f+=1
        else:
            ans[f]+=1
            f=1
ans[0]=z-sum(ans)
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
h,w,n=map(int,input().split())
z=(h-2)*(w-2)
p=[]
for i in range(n):
    x,y=map(int,input().split())
    for j in range(3):
        for k in range(3):
            p.append([x+j-1,y+k-1])
p.sort()
n=len(p)
p.append([10**20,10**20])
ans=[0]*10
f=1
for i in range(n):
    if 2<=p[i][0]<=h-1 and 2<=p[i][1]<=w-1:
        if p[i]==p[i+1]:
            f+=1
        else:
            ans[f]+=1
            f=1
ans[0]=z-sum(ans)
for i in ans:
    print(i)

Fixed submission:
import sys
input=sys.stdin.readline
h,w,n=map(int,input().split())
z=(h-2)*(w-2)
p=[]
for i in range(n):
    x,y=map(int,input().split())
    for j in range(3):
        for k in range(3):
            p.append([x+j-1,y+k-1])
p.sort(key=lambda x:(10**10)*x[0]+x[1])
n=len(p)
p.append([10**20,10**20])
ans=[0]*10
f=1
for i in range(n):
    if 2<=p[i][0]<=h-1 and 2<=p[i][1]<=w-1:
        if p[i]==p[i+1]:
            f+=1
        else:
            ans[f]+=1
            f=1
ans[0]=z-sum(ans)
for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
li=list(map(int,input().split()))
mi=min(li)
ind=-1
for i in range(n):
    if mi==li[i]:
        ind=i
ans=[0]*n
ans[0]=li[ind]
k=0
for i in range(1,n):
    if ind+i>=n:
        k=ind+i-n
    else:
        k=ind+i
    ans[i]=min(li[k],ans[i-1]+x)
print(sun(ans))

Fixed submission:
n,x=map(int,input().split())
a=list(map(int,input().split()))
b=a[:]
ans=10**20
for i in range(n):
    for j in range(n):
        b[j]=min(b[j],a[j-i])
    ans=min(ans,sum(b)+x*i)
print(ans)
Buggy python submission (verdict: Runtime Error):
s=list(input())
if len(s)==2:
    if s[0]==s[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()
for i in range(len(s)-1):
    if l[i]==l[i+1]:
        print(*[i+1,i+2])
        exit()
for i in range(len(s)-2):
    if l[i]==l[i+2]:
        print(*[i+1,i+3])
        exit()
print('-1 -1')

Fixed submission:
l=list(input())
if len(l)==2:
    if l[0]==l[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()
for i in range(len(l)-1):
    if l[i]==l[i+1]:
        print(*[i+1,i+2])
        exit()
for i in range(len(l)-2):
    if l[i]==l[i+2]:
        print(*[i+1,i+3])
        exit()
print('-1 -1')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=int(0)

for i in range(1,n+1):
    now=int(n/i)
    ans+=int(now*(now+1)/2*i)
print(ans)

Fixed submission:
n=int(input())
ans=int(0)

for i in range(1,n+1):
    now=int(n/i)
    ans+=int(now*(now+1)/2*i)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

A=list(map(int,input().split()))
ans=int(1)

for i in range(n):
    ans*=A[i]
if ans>1e18:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())

A=list(map(int,input().split()))
A.sort()

ans=int(1)

for i in range(n):
    ans*=A[i]
    if ans>1e18:
        print(-1)
        exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

A=list(map(int,input().split()))
A.sort()

ans=int(1)

for i in range(n):
    ans*=A[i]
if ans>1e18:
    print(-1)
else:
    print(ans)

Fixed submission:
n=int(input())

A=list(map(int,input().split()))
A.sort()

ans=int(1)

for i in range(n):
    ans*=A[i]
    if ans>1e18:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,n=map(int,input().split())
x=0
if n>b:
    x=b
else:
  x=n
ans1=int(a*x/b)-a*int(x/b)
print(ans2)

Fixed submission:
a,b,n=map(int,input().split())
x=0
if n>b-1:
    x=b-1
else:
  x=n
ans=int(a*x/b)-a*int(x/b)
print(ans)
Buggy python submission (verdict: Runtime Error):
asn=int(0)
for i in range(int(input())):
    if i%3!=0 and i%5!=0:
        ans+=i
print(ans)

Fixed submission:
ans=int(0)
for i in range(int(input())+1):
    if i%3!=0 and i%5!=0:
        ans+=i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
ans=int(0)
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            g=math.gcd(i,j)
            ans+=math.gcd(g,k)
print(ans)

Fixed submission:
import math
n=int(input())
ans=int(0)
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            g=math.gcd(i,j)
            ans+=math.gcd(g,k)
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
for i in range(n):
    if s[i]!=s[n-1-i]:
        print("No")
        exit()
harf=int((n-1)/2
for i in range(harf):
    if s[i]!=s[harf-1-i]:
        print("No")
        exit()
for i in range(harf+1,n):
    if s[i]!=s[n-1-(i-harf-1)]:
        print("No")
        exit()
print("Yes")

Fixed submission:
s=input()
n=len(s)
ans=1
for i in range(n):
    if s[i]!=s[n-1-i]:
        ans=0
harf=int((n-1)/2)
for i in range(harf):
    if s[i]!=s[harf-1-i]:
        ans=0
for i in range(harf+1,n):
    if s[i]!=s[n-1-(i-harf-1)]:
        ans=0
if ans==1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if c-a-b<0:
	print("No")
    exit()
if (c-a-b)*(c-a-b)>4*a*b:
    print("Yes")
else:
    print("No")

Fixed submission:
import math
a,b,c=map(int,input().split())
if c-a-b<0:
    print("No")
    exit()
if (c-a-b)*(c-a-b)>4*a*b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s=str(input())
n=len(s)
ans=1
for i in range(n):
    if s[i]!='h' or s[i+1]!='i':
        a=0
    i+=1

if ans==1:
    print("Yes")
else:
    print("No")

Fixed submission:
s=str(input())
n=len(s)
ans=1
if n%2==1:
    ans=0

for i in range(n):
    if i%2==0 and s[i]!='h':
        ans=0
    if i%2==1 and s[i]!='i':
        ans=0
if ans==1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,r=map(int,input().split())
if n>10:
	print(r)
else:
	print(r-1000+100*k)

Fixed submission:
n,r=map(int,input().split())
if n>10:
	print(r)
else:
	print(r+1000-100*n)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
A.sort()
ans=int(0)
for i in range(n-2):
    for j in range(i+1,n-1):
        now=A[i]+A[j]
        l=int(j+1)
        r=int(n)
        while r-l>=1:
            x=int((r+l)/2)
            if A[x]<now:
                l=x+1
            else:
                r=x
        ans+=r-j-1
print(ans)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
A.sort()
ans=int(0)
for i in range(n-2):
    for j in range(i+1,n-1):
        now=A[i]+A[j]
        l=int(j+1)
        r=int(n)
        while r-l>=1:
            x=int((r+l)/2)
            if A[x]<now:
                l=x+1
            else:
                r=x
        ans+=r-j-1
print(ans)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  	cin>>n;
  cout<<n*n*3<<endl;
}


Fixed submission:
a=int(input())
print(a*a*3)
Buggy python submission (verdict: Time Limit Exceeded):
l,r=map(int,input().split())
ans=int(10000000)
if r-l>2019:
    ans=0

for i in range(l,r):
    for j in range(i+1,r+1):
        now=int((i*j)%2019)
        if ans>now:
            ans=now

print(ans)

Fixed submission:
l,r=map(int,input().split())
ans=int(10000000)
if r-l>2019:
    print(0)
    exit()

for i in range(l,r):
    for j in range(i+1,r+1):
        now=int((i*j)%2019)
        if ans>now:
            ans=now

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l,r=map(int,input().split())
ans=int(10000000)
if r-l>2019:
    ans=0

for i in range(l,r):
    for j in range(i+1,r+1):
        now=int((i*j)%2019)
        if ans>now:
            ans=now

print(ans)

Fixed submission:
l,r=map(int,input().split())
ans=int(10000000)
if r-l>2019:
    print(0)
    exit()

for i in range(l,r):
    for j in range(i+1,r+1):
        now=int((i*j)%2019)
        if ans>now:
            ans=now

print(ans)

Buggy python submission (verdict: Runtime Error):
l,r=map(int,input().split())
if r-l>2019:
    print(0)
    exit()

ans=int(10000000)
for i in range(l,r):
    for j in range(j+1,r+1):
        if ans>i*j:
            ans=i*j

print(ans)

Fixed submission:
l,r=map(int,input().split())
ans=int(10000000)
if r-l>2019:
    print(0)
    exit()

for i in range(l,r):
    for j in range(i+1,r+1):
        now=int((i*j)%2019)
        if ans>now:
            ans=now

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
print((k//2)*((k+1)//2))

Fixed submission:
n=int(input())
o=int(n/2)
e=int((n+1)/2)
print(o*e)

Buggy python submission (verdict: Runtime Error):
n=int(input())
print((k//2)*(k//2+1))

Fixed submission:
n=int(input())
o=int(n/2)
e=int((n+1)/2)
print(o*e)
Buggy python submission (verdict: Runtime Error):
A=lsit(map(int,input().split()))
ans=int(0)
m=max(A)
for i in range(3):
    now=int((m-A[i])/2)
    ans+=now
    A[i]+=2*now

check=int(0)
for i in range(3):
    check+=m-A[i]
if check==0:
    print(ans)
elif check==2:
    print(ans+1)
else:
    print(ans+2)

Fixed submission:
A=list(map(int,input().split()))
ans=int(0)
m=max(A)
for i in range(3):
    now=int((m-A[i])/2)
    ans+=now
    A[i]+=2*now

check=int(0)
for i in range(3):
    check+=m-A[i]
if check==0:
    print(ans)
elif check==2:
    print(ans+1)
else:
    print(ans+2)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
ans=int(0)
for i in ramge(n-k,n):
	ans+=A[i]
print(ans)


Fixed submission:
n,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
ans=int(0)
for i in range(n-k,n):
	ans+=A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
ans=int(0)
for i in ramge(n-k,n):
    ans+=A[i]
print(ans)

Fixed submission:
n,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
ans=int(0)
for i in range(n-k,n):
	ans+=A[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
ans=int(0)
for i in ramge(n-k,n):
    ans+=A[i]
print(ans)

Fixed submission:
n,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
ans=int(0)
for i in range(n-k,n):
	ans+=A[i]
print(ans)