Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,a=map(int,input().split())
x=list(map(int,input().split()))
x.sort(reverse=True)
sx=sum(x)
dp=[[0]*(n+1) for i in range(sx+1)]
dp[0][0]=1
for i in range(n):
    dp_sub=[[0]*(n+1) for j in range(sx+1)]
    for j in range(sx+1):
        for k in range(n+1):
            if (j==0 and k==0) or dp[j][k]!=0:
                dp_sub[j+x[i]][k+1]=dp[j][k]
    for j in range(sx+1):
        for k in range(n+1):
            dp[j][k]+=dp_sub[j][k]
cnt=0

for i in range(min(sx//a,n)):
    cnt+=dp[a*(i+1)][i+1]
#print(dp)
print(cnt)

Fixed submission:
n,a=map(int,input().split())
x=list(map(int,input().split()))
x.sort(reverse=True)
sx=sum(x)
dp=[[0]*(n+1) for i in range(sx+1)]
dp[0][0]=1
for i in range(n):
    dp_sub=[[0]*(n+1) for j in range(sx+1)]
    for j in range(sx+1):
        for k in range(n+1):
            if (j==0 and k==0) or dp[j][k]!=0:
                dp_sub[j+x[i]][k+1]=dp[j][k]
    for j in range(sx+1):
        for k in range(n+1):
            dp[j][k]+=dp_sub[j][k]
cnt=0

for i in range(min(sx//a,n)):
    cnt+=dp[a*(i+1)][i+1]
#print(dp)
print(cnt)
Buggy python submission (verdict: Runtime Error):
import exit from sys
s=input()
l=len(s)
for i in range(l-2):
    if s[i]==s[i+2]:
        print(str(i+1)+" "+str(i+3))
        exit()
    if s[i]==s[i+1]:
        print(str(i+1)+" "+str(i+2))
        exit()
if s[l-2]==s[l-1]:
    print(str(l-1)+" "+str(l))
else:
    print("-1 -1")


Fixed submission:
def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2
s1=list(input())
l=len(s1)
s2=groupby(s1)
now=0
for i in s2:
    now+=i[1]
    if i[1]!=1:
        print(str(now-i[1]+1)+" "+str(now))
        break
else:
    if l==2:
        print("-1 -1")
    else:
        for i in range(l-2):
            if s1[i]==s1[i+2]:
                print(str(i+1)+" "+str(i+3))
                break
        else:
            print("-1 -1")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
b=0

for i in range(0,N):
    if A[i]%(10**9)+7==0:
        del A[i]

for i in range(0,len(A)-1):
    for j in range(i+1,len(A)):
        b+=A[i]*A[j]
        
print(b%(10**9+7))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
b=0
c=0

for j in range(0,len(A)):
    c+=A[j]

for i in range(0,len(A)):
        c=c-A[i]
        b+=A[i]*c
        
print(b%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
b=0

for i in range(0,N-1):
    for j in range(i+1,N):
        b+=A[i]*A[j]
        
print(b%(10**9+7))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
b=0
c=0

for j in range(0,len(A)):
    c+=A[j]

for i in range(0,len(A)):
        c=c-A[i]
        b+=A[i]*c
        
print(b%(10**9+7))
Buggy python submission (verdict: Runtime Error):
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

a,b=[0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
    
v,j=0,M

for i in range(N+1):
    if a[i]>K:
        break
    while b[j]>K-a[i]:
        j-=1
    v=max(b,i+j)

print(v)
       


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

a,b=[0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
    
v,j=0,M

for i in range(N+1):
    if a[i]>K:
        break
    while b[j]>K-a[i]:
        j-=1
    v=max(v,i+j)

print(v)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
S=[]
b=0

for i in (K):
    d=input()
    A=list(map(int,input().split()))
    for i in A:
        S[i]+=1

for i in (len(S)):
    if S[i]==0:
        b+=1
print(b)

Fixed submission:
N,K=map(int,input().split())
S=[0]*N
b=0

for i in range(K):
    d=input()
    A=list(map(int,input().split()))
    for j in A:
        S[j-1]+=1

for i in range(len(S)):
    if S[i]==0:
        b+=1
print(b)
Buggy python submission (verdict: Runtime Error):
S,W=map(int,input().split())

if S>W:
    print("safe")
else:
    print("unsafe"

Fixed submission:
S,W=map(int,input().split())

if S>W:
    print("safe")
else:
    print("unsafe")
Buggy python submission (verdict: Runtime Error):
N=int(input())
b=0

for i in range(0,N):
    S[i]=input()

b=collections.Counter(S)
print(len(S))

Fixed submission:
from collections import Counter
N=int(input())
b=0
S=[]

for i in range(0,N):
    S.append(input())
b=Counter(S)
print(len(b))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
b=0

for i in range(0,N):
    S=input()
    if not S in A:
        b+=1
        A.append(S)
print(b)

Fixed submission:
from collections import Counter
N=int(input())
b=0
S=[]

for i in range(0,N):
    S.append(input())
b=Counter(S)
print(len(b))
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))

if N>=sum(A):
    print(N-A)
else:
    print(-1)

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

if N>=B:
    print(N-B)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
S = input()
if(S[-1]=='s'):
  del S[-1]
  S=S+'es'
else:
  S=S+'s'
print(S)

Fixed submission:
S = input()
if(S[-1]=='s'):
  S=S+'es'
else:
  S=S+'s'
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A= list(map(int,input().split()))
mod_num = 1.0e+9 + 7
for i in range(len(A)):
  A[i]= A[i]%mod_num
rest = 0
for i in range(N-1):
  for j in range(N-i-1):
    rest +=A[i]*A[i+j+1]
    

    
print(int(rest%mod_num))

Fixed submission:
N = int(input())
A= list(map(int,input().split()))
mod_num = int(1.0e+9 + 7)
rest = 0
temp = 0

for i in range(N-1):
  temp+=A[i]
  rest += temp*A[i+1]
  rest = rest%mod_num

print(int(rest%mod_num))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A= list(map(int,input().split()))
mod_num = 1.0e+9 + 7
for i in range(len(A)):
  A[i]= A[i]%mod_num
rest = 0
for i in range(N-1):
  for j in range(N-i-1):
    rest +=A[i]*A[i+j+1]
    if(rest>=mod_num):
    	rest=rest%mod_num

    
print(int(rest%mod_num))

Fixed submission:
N = int(input())
A= list(map(int,input().split()))
mod_num = int(1.0e+9 + 7)
rest = 0
temp = 0

for i in range(N-1):
  temp+=A[i]
  rest += temp*A[i+1]
  rest = rest%mod_num

print(int(rest%mod_num))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A= list(map(int,input().split()))
mod_num = 1.0e+9 + 7
rest = 0
for i in range(N-1):
  for j in range(N-i-1):
    rest +=(A[i]%mod_num)*(A[i+j+1]%mod_num)
    rest=rest%mod_num

print(int(rest%mod_num))

Fixed submission:
N = int(input())
A= list(map(int,input().split()))
mod_num = int(1.0e+9 + 7)
rest = 0
temp = 0

for i in range(N-1):
  temp+=A[i]
  rest += temp*A[i+1]
  rest = rest%mod_num

print(int(rest%mod_num))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A= list(map(int,input().split()))
mod_num = 1.0e+9 + 7
rest = 0
for i in range(N-1):
  for j in range(N-i-1):
    rest +=(A[i]*A[i+j+1])%mod_num

print(int(rest%mod_num))

Fixed submission:
N = int(input())
A= list(map(int,input().split()))
mod_num = int(1.0e+9 + 7)
rest = 0
temp = 0

for i in range(N-1):
  temp+=A[i]
  rest += temp*A[i+1]
  rest = rest%mod_num

print(int(rest%mod_num))
Buggy python submission (verdict: Time Limit Exceeded):
def II(): return int(input())

#bit全部作ってる
#bit = [i>>j&1 for j in range(n)]

n=II()
count=0
for a in range(1,n):
    for b in range(1,n):
        c=n-a*b
        if 1<=c:
            count+=1
print(count)

Fixed submission:
def II(): return int(input())

n=II()
count=0
for a in range(1,n):
    m=int(n/a)+1
    for b in range(1,m):
        c=n-a*b
        if 1<=c:
            count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input)

for i in range(1,10):
    for j in range(i,10):
        if n==i*j:
            print("Yes")
            exit()
print("No")

Fixed submission:
n=int(input())

for i in range(1,10):
    for j in range(i,10):
        if n==i*j:
            print("Yes")
            exit()
print("No")
Buggy python submission (verdict: Runtime Error):
s=input()

tmp=0
length=[]

for i in range(len(s)):
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        tmp+=1
    else:
        length.append(tmp)
        tmp=0
print(max(length))

Fixed submission:
s=input()

tmp=0
length=[]

for i in range(len(s)):
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        tmp+=1
        if i==len(s)-1:
            length.append(tmp)
    else:
        length.append(tmp)
        tmp=0
print(max(length))
Buggy python submission (verdict: Runtime Error):
x=input()
if x[-1]=='s'
  x+="es"
else:
  x+="s"
  
print(x)

Fixed submission:
x=input()

if x[-1]=='s':

  x+="es"

else:

  x+="s"

  

print(x)
Buggy python submission (verdict: Runtime Error):
n=int(input())
count=0
ren=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    if count<3:
      count+=1
      ren=1
  else if count<3:
    count=0
if count>=3:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
count=0
ren=0
for i in range(n):
  a,b=map(int,input().split())
  if a==b:
    if count<3:
      count+=1
      ren=1
  elif count<3:
    count=0
if count>=3:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import numpy

e=input().split()
for i in range(len(e)):
  e[i]=int(e[i])
x=e[0]
k=e[1]
d=e[2]
t=k
if k>10000:
 if k%2==0:
   t=10000
 else:
   t=10001
kou=numpy.gcd(x,d)
x=int(x/kou)
d=int(d/kou)
if d>100 and d%2==0:
  d=100
if d>100 and d%2==1:
  d=1001
for i in range(t):
  if abs(x+d)<abs(x-d):
    x+=d
  else:
    x-=d
print(abs(x)*kou)


Fixed submission:
w=input()
count=0

if w=="SSS":
 print(0)
if w=="SSR":
 print(1)
if w=="SRR":
 print(2)
if w=="RRS":
 print(2)
if w=="RSR":
 print(1)
if w=="SRS":
 print(1)
if w=="RSS":
 print(1)
if w=="RRR":
 print(3)
Buggy python submission (verdict: Runtime Error):
X=input()

if X >= 30:
  return Yes
else:
  return No

Fixed submission:
X = int(input())

if X>=30:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list=[[0]*n]
list=input().split()
for i in range(n):
  list[i]=int(list[i])

yen=1000
stock=0
keikou=0
for i in range(1,n):
  if list[i]-list[i-1]<=0:
    keikou+=1
if keikou!=n-1:
  for t in range(1,n):
    if list[t]-list[t-1]>=0:
      while(yen>=list[t-1]):
        yen-=list[t-1]
        stock+=1
      yen+=list[t]*stock
      stock=0
print(yen)

Fixed submission:
n=int(input())
list=[[0]*n]
list=input().split()
for i in range(n):
  list[i]=int(list[i])

yen=1000
stock=0
keikou=0
for i in range(1,n):
  if list[i]-list[i-1]<=0:
    keikou+=1
if keikou!=n-1:
  for t in range(1,n):
    if list[t]-list[t-1]>=0:
      stock+=int(yen/list[t-1])
      yen-=list[t-1]*int(yen/list[t-1])
      yen+=list[t]*stock
      stock=0
print(yen)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list=[[0]*n]
list=input().split()
for i in range(n):
  list[i]=int(list[i])

yen=1000
stock=0
keikou=0
for i in range(1,n):
  if list[i]-list[i-1]<=0:
    keikou+=1
if keikou!=n-1:
  list2=sorted(list)
  list.index(list2[0])
  
  for t in range(1,n):
    if list[t]-list[t-1]>=0:
      while(yen>=list[t-1]):
        yen-=list[t-1]
        stock+=1
      yen+=list[t]*stock
      stock=0
print(yen)

Fixed submission:
n=int(input())
list=[[0]*n]
list=input().split()
for i in range(n):
  list[i]=int(list[i])

yen=1000
stock=0
keikou=0
for i in range(1,n):
  if list[i]-list[i-1]<=0:
    keikou+=1
if keikou!=n-1:
  for t in range(1,n):
    if list[t]-list[t-1]>=0:
      stock+=int(yen/list[t-1])
      yen-=list[t-1]*int(yen/list[t-1])
      yen+=list[t]*stock
      stock=0
print(yen)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list=[[0]*n]
list=input().split()
for i in range(n):
  list[i]=int(list[i])

yen=1000
stock=0
keikou=0
for i in range(1,n):
  if list[i]-list[i-1]<=0:
    keikou+=1
if keikou!=n-1:
  list2=sorted(list)
  list.index(list2[0])
  
  for t in range(1,n):
    if list[t]-list[t-1]>=0:
      while(yen>=list[t-1]):
        yen-=list[t-1]
        stock+=1
      while(stock>0):
        yen+=list[t]
        stock-=1
print(yen)


Fixed submission:
n=int(input())
list=[[0]*n]
list=input().split()
for i in range(n):
  list[i]=int(list[i])

yen=1000
stock=0
keikou=0
for i in range(1,n):
  if list[i]-list[i-1]<=0:
    keikou+=1
if keikou!=n-1:
  for t in range(1,n):
    if list[t]-list[t-1]>=0:
      stock+=int(yen/list[t-1])
      yen-=list[t-1]*int(yen/list[t-1])
      yen+=list[t]*stock
      stock=0
print(yen)
Buggy python submission (verdict: Runtime Error):
for i in range(10):
 if N>1000:
  N-=1000
 if N<1000:
  break

print(1000-N)

Fixed submission:
N=int(input())

for i in range(10):
 if N>1000:
  N-=1000
 if N<1000:
  break

print(1000-N)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

temp=0

for i in range(n):
    c=a.count(i)
    temp=temp+int(c*(c-1)/2)

for k in range(n):
    ch=a[k]
    c2=a.count(ch)
    if c2==0 or c2==1:
        print(temp)
    else:
        ans=temp-int(c2*(c2-1)/2)+int((c2-1)*(c2-2)/2)
        print(ans)


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

temp=0

s=[0]*n

for i in range(n):
    s[a[i]-1]=s[a[i]-1]+1

for i in range(n):
    c=s[i]
    temp=temp+int(c*(c-1)/2)

for k in range(n):
    ch=a[k]
    c2=s[ch-1]
    if c2==0 or c2==1:
        print(temp)
    else:
        ans=temp-int(c2*(c2-1)/2)+int((c2-1)*(c2-2)/2)
        print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k =map(int,input().split())
p=list(map(int,input().split()))

tem=0
ans=0

for i in range(n-k+1):
    tem=0
    if i>1 and p[i-1]>p[i+k-1]:
        continue
    for j in range(k):
        tem=tem+(p[i+j]/2)+1/2
    ans=max(ans,tem)

print(ans)

Fixed submission:
n,k =map(int,input().split())
p=list(map(int,input().split()))

tem=0
ans=0

for i in range(k):
    ans=ans+(p[i]/2)+1/2
    tem=tem+(p[i]/2)+1/2

for i in range(1,n-k+1):
    fi=p[i-1]/2 +1/2
    la=p[i+k-1]/2 +1/2
    tem=tem-fi+la
    ans=max(ans,tem)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k =map(int,input().split())
p=list(map(int,input().split()))

tem=0
ans=0

for i in range(n-k+1):
    tem=0
    for j in range(k):
        tem=tem+(p[i+j]/2)+1/2
    ans=max(ans,tem)

print(ans)

Fixed submission:
n,k =map(int,input().split())
p=list(map(int,input().split()))

tem=0
ans=0

for i in range(k):
    ans=ans+(p[i]/2)+1/2
    tem=tem+(p[i]/2)+1/2

for i in range(1,n-k+1):
    fi=p[i-1]/2 +1/2
    la=p[i+k-1]/2 +1/2
    tem=tem-fi+la
    ans=max(ans,tem)

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

for i in range(1,n+1):
    caca=int(a[i-1])
    lis[caca-1]=i

print(' '.join(map(str, lis)))

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

lis=[0]*n

for i in range(1,n+1):
    caca=int(a[i-1])
    lis[caca-1]=i

print(' '.join(map(str, lis)))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

ans=0

for i in range(n):
    ans=ans+i

print(ans)

Fixed submission:
n=int(input())

if n%2==0:
    neko=int(n/2)
    ans=neko*(n-1)
    print(ans)

if n%2==1:
    neko=int((n-1)/2)
    ans=neko*n
    print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
l=len(s)
S=str()

cnt=0
ck=0
for i in range(l):
    if ck==l-1:
        if s[ck]==S:
            break
        else:
            cnt+=1
        break
    if i==0:
        cnt=cnt+1
        S=s[0]
        ck+=1
        continue
    if s[ck]==S:
        S=s[ck]+s[ck+1]
        ck=ck+2
        cnt=cnt+1
        continue
    if s[ck]!=S:
        S=s[ck]
        ck=ck+1
        cnt=cnt+1
        continue

print(cnt)

Fixed submission:
s=input()
l=len(s)
S=str()

cnt=0
ck=0

for i in range(l):
    if ck==l-1:
        if s[ck]==S:
            break
        else:
            cnt+=1
        break
    if i==0:
        cnt=cnt+1
        S=s[0]
        ck+=1
        continue
    if s[ck]==S:
        S=s[ck]+s[ck+1]
        ck=ck+2
        cnt=cnt+1
        if ck==l:
            break
        else:
            continue
    if s[ck]!=S:
        S=s[ck]
        ck=ck+1
        cnt=cnt+1
        continue

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())

for k in range(10**9+1):
    if abs(a-k)==abs(b-k):
        print(k)
        c=1
        break

if c!=1:
    print("IMPOSSIBLE")

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

if (a+b) % 2==1:
    print("IMPOSSIBLE")

else:
    k=int((a+b)/2)
    if abs(a-k)==abs(b-k):
        print(k)
Buggy python submission (verdict: Runtime Error):
n=int(input())
p=map(int,input().split())

c=0
for i in range(1,n):
    if p[i-1]>p[i]:
        c=c+1

if c<=1:
    print("YES")
else:
    print("NO")

Fixed submission:
n=int(input())
p=list(map(int,input().split()))

c=0
d=0
for i in range(n):
    if p[i]==i+1:
        continue
    else:
        c=c+1
        if c>=3:
            break
        if d==0:
            d=i+1
            continue
        if d!=0:
            if d!=p[i]:
                c=3
                break

if c<=2:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
n=int(input())
p=map(int,input().split())

c=0:
for i in range(1,n):
    if p[i-1]>p[i]:
        c=c+1

if c<=1:
    print("YES")
else:
    print("NO")

Fixed submission:
n=int(input())
p=list(map(int,input().split()))

c=0
d=0
for i in range(n):
    if p[i]==i+1:
        continue
    else:
        c=c+1
        if c>=3:
            break
        if d==0:
            d=i+1
            continue
        if d!=0:
            if d!=p[i]:
                c=3
                break

if c<=2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
l,r=map(int,input().split())

ans=2018
for i in range(l,r):
    for j in range(i+1,r+1):
        ch=(i*j)%2019
        ans=min(ch,ans)

print(ans)

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

ans=2018
for i in range(l,r):
    if i%2019==0:
        ans=0
        break
    if i%673==0:
        for j in range(i+1,r+1):
            if j%3==0:
                ans=0
                break
            ch=(i*j)%2019
            ans=min(ch,ans)
    if i%3==0:
        for j in range(i+1,r+1):
            if j%673==0:
                ans=0
                break
            ch=(i*j)%2019
            ans=min(ch,ans)

    if ans==0:
        break
    for j in range(i+1,r+1):
        ch=(i*j)%2019
        ans=min(ch,ans)
        if j%2019==0:
            ans=0
            break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

sum=0
for i in range(n):
    sum=sum+a[i]

for j in range(1,n,2):
    sum=sum-a[j]*2

ans=[sum]
ch=sum
for i in range(0,n-1):
    ch=a[i]*2-ch
    ans.append(ch)


aaa=str(ans[0])
for i in range(1,n):
    ccd=str(ans[i])
    aaa=aaa+' '+ccd
print(aaa)

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

sum=0
for i in range(n):
    sum=sum+a[i]

for j in range(1,n,2):
    sum=sum-a[j]*2

ans=[sum]
ch=sum
for i in range(0,n-1):
    ch=a[i]*2-ch
    ans.append(ch)

print(' '.join(map(str, ans)))

Buggy python submission (verdict: Runtime Error):
    n=int(input())
    a=list(map(int,input().split()))
     
    sum=0
    for i in range(n):
        sum=sum+a[i]
     
    for j in range(1,n,2):
        sum=sum-a[j]*2
     
    ans=[sum]
    ch=sum
    for i in range(0,n-1):
        ch=a[i]*2-ch
        ans.append(ch)
     
     
    aaa=str(ans[0])
    for i in range(1,n):
        ccd=str(ans[i])
        aaa=aaa+' '+ccd
    print(aaa)

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

sum=0
for i in range(n):
    sum=sum+a[i]

for j in range(1,n,2):
    sum=sum-a[j]*2

ans=[sum]
ch=sum
for i in range(0,n-1):
    ch=a[i]*2-ch
    ans.append(ch)

print(' '.join(map(str, ans)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

sum=0
for i in range(n):
    sum=sum+a[i]

for j in range(1,n,2):
    sum=sum-a[j]*2

ans=[sum]
ch=sum
for i in range(0,n-1):
    ch=a[i]*2-ch
    ans.append(ch)


aaa=str(ans[0])
for i in range(1,n):
    ccd=str(ans[i])
    aaa=aaa+' '+ccd
print(aaa)

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

sum=0
for i in range(n):
    sum=sum+a[i]

for j in range(1,n,2):
    sum=sum-a[j]*2

ans=[sum]
ch=sum
for i in range(0,n-1):
    ch=a[i]*2-ch
    ans.append(ch)

print(' '.join(map(str, ans)))
Buggy python submission (verdict: Runtime Error):
import numpy as np

n=int(input())
a=[0]*n
b=[0]*n
for i in range(n):
    a[i],b[i]=map(int,input().split())

A=np.array(b)
c=A.argsort()

time=0

for i in range(n):
    time=time+a[c[i]]
    if time>b[c[i]]:
        print('No')
        break
    if i==n-1 and time<=b[c[i]]:
        print('Yes')

Fixed submission:
import numpy as np

n=int(input())
a=[0]*n
b=[0]*n
for i in range(n):
    a[i],b[i]=map(int,input().split())

A=np.array(b)
c=A.argsort()

time=0

for i in range(n):
    time=time+a[c[i]]
    if time>b[c[i]]:
        print('No')
        break
    if i==n-1 and time<=b[c[i]]:
        print('Yes')
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
for _ in range(m):
   a.append(input())

def fb(num):
    a, b = 1, 0
    for _ in range(num):
        a, b = a + b, a
    if num==-1:
        b=0
    return b 

sum=fb(int(a[0]))

for i in range(m-1):
    sum=sum*fb(int(a[i+1])-int(a[i])-1)

sum=sum*fb(n-int(a[m-1]))

print(sum % (10**9+7))

Fixed submission:
n,m=map(int,input().split())
a=[]
for _ in range(m):
   a.append(input())

def fb(num):
    a, b = 1, 0
    for _ in range(num):
        a, b = a + b, a
    if num==-1:
        b=0
    return b 

if m==0:
    print(fb(n+1) % (10**9+7))
    
else:
    sum=fb(int(a[0]))

    for i in range(m-1):
        sum=sum*fb(int(a[i+1])-int(a[i])-1)

    sum=sum*fb(n-int(a[m-1]))

    print(sum % (10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())
count=0
wa=0
for i in range(int(N/R)+1):
    for j in range(int((N-i*R)/G)+1):
       b=(N-i*R-j*G)/B
       if b>=0 and float.is_integer(b)==True:
           count=count+1
     
print(count)

Fixed submission:
R,G,B,N=map(int,input().split())
count=0
wa=0
for i in range(int(N/R)+1):
    for j in range(int((N-i*R)/G)+1):
        b=(N-i*R-j*G)/B
        if b>=0 and float.is_integer(b)==True:
            count=count+1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())
count=0
wa=0
for i in range(int(N/R)+1):
    for j in range(int((N-i*R)/G)+1):
        for k in range(int((N-i*R-j*G)/B)+1):
            wa=i*R+j*G+k*B
            if wa==N:
                count=count+1

print(count)

Fixed submission:
R,G,B,N=map(int,input().split())
count=0
wa=0
for i in range(int(N/R)+1):
    for j in range(int((N-i*R)/G)+1):
        b=(N-i*R-j*G)/B
        if b>=0 and float.is_integer(b)==True:
            count=count+1

print(count)
Buggy python submission (verdict: Runtime Error):
a=input()

if a="A" or "T":
    if a=="T":
        b="A"
    if a=="A":
        b="T"

if a="C" or "G":
    if a=="C":
        b="G"
    if a=="G":
        b="C"

print(b)

Fixed submission:
a=input()

if a=="A" or "T":
    if a=="T":
        b="A"
    if a=="A":
        b="T"

if a=="C" or "G":
    if a=="C":
        b="G"
    if a=="G":
        b="C"

print(b)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().sprit())
if A<=5:
  print(0)
elif A<=12:
  print(B//2)
else:
  print(B)

Fixed submission:
A,B = map(int,input().split())
if A<=5:
  print(0)
elif A<=12:
  print(B//2)
else:
  print(B)