Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==5 and b==7 and c==5:
  print(YES)
elif a==5 and b==5 and c==7:
  print(YES)
elif a==7 and b==5 and c==5:
  print(YES)
else:
  print(NO) 

Fixed submission:
a,b,c=map(int,input().split())
if a==5 and b==7 and c==5:
  print('YES')
elif a==5 and b==5 and c==7:
  print('YES')
elif a==7 and b==5 and c==5:
  print('YES')
else:
  print('NO')

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==5 and b==7 and c==5&:
  print(YES)
elif a==5 and b==5 and c==7&:
  print(YES)
elif a==7 and b==5 and c==5&:
  print(YES)
else:
  print(NO) 

Fixed submission:
a,b,c=map(int,input().split())
if a==5 and b==7 and c==5:
  print('YES')
elif a==5 and b==5 and c==7:
  print('YES')
elif a==7 and b==5 and c==5:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
R,C,K = ma()
V = [[0 for i in range(R+1)] for j in range(C+1)]
for i in range(K):
    r,c,v = ma()
    V[c][r] = v
dp_prev = [[0]*4 for i in range(C+1)]
dp_nex = [[0]*4 for i in range(C+1)] #dp[h][k] h列目でmax kこまで選んだ時の最大値
for r in range(1,R+1):
    for c in range(1,C+1):
        v = V[c][r]
        for k in range(4):
            if k==0:
                dp_nex[c][0] = max(dp_prev[c][3],dp_nex[c-1][0])
            elif k >0:
                dp_nex[c][k] = max(dp_nex[c-1][k],dp_nex[c-1][k-1]+v,dp_prev[c][3]+v)
    dp_prev,dp_nex = dp_nex,dp_prev
    #print(dp_prev)


print(dp_prev[C][3])


Fixed submission:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
R,C,K = ma()
V = [[0 for i in range(R+1)] for j in range(C+1)]
for i in range(K):
    r,c,v = ma()
    V[c][r] = v
dp_prev = [[0]*4 for i in range(C+1)]
dp_nex = [[0]*4 for i in range(C+1)] #dp[h][k] h列目でmax kこまで選んだ時の最大値
for r in range(1,R+1):
    for c in range(1,C+1):
        v = V[c][r]
        for k in range(4):
            if k==0:
                dp_nex[c][0] = max(dp_prev[c][3],dp_nex[c-1][0])
            elif k >0:
                dp_nex[c][k] = max(dp_nex[c-1][k],dp_nex[c-1][k-1]+v,dp_prev[c][3]+v)
    dp_prev,dp_nex = dp_nex,dp_prev
    #print(dp_prev)


print(dp_prev[C][3])
Buggy python submission (verdict: Runtime Error):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n,d = ma()
cnt=0
for i in range(n):
    p,q = ma()
    if p**2 + q**2 <=D**2:
        cnt+=1
print(cnt)


Fixed submission:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n,d = ma()
cnt=0
for i in range(n):
    p,q = ma()
    if p**2 + q**2 <=d**2:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
k = ni()
a = 0
for i in range(10**7):
    a=(a+7*pow(10,i,k))%k
    if a== 0:
        print(i+1)
        exit()


Fixed submission:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
k = ni()
a = 0
for i in range(10**6):
    a=(a+7*pow(10,i,k))%k
    if a== 0:
        print(i+1)
        break
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n,k = ma()
A = list(ma())
s = 1
zeros = [0 for i in range(n+1)]
for i in range(k):
    s*=A[i]
    if A[i] ==0:
        zeros[i] +=1
        zeros[min(n,i+k)] -=1
for i in range(1,n+1):
    zeros[i] += zeros[i-1]
for i in range(k,n):
    if zeros[i] >0:
        f = False
        yn(f)
        continue
    if A[i] > A[i-k]:
        f =True
    else:
        f=False
    yn(f)


Fixed submission:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n,k = ma()
A = list(ma())
s = 1
zeros = [0 for i in range(n+1)]
for i in range(k):
    if A[i] ==0:
        zeros[i] +=1
        zeros[min(n,i+k)] -=1
for i in range(1,n+1):
    zeros[i] += zeros[i-1]
for i in range(k,n):
    if zeros[i] >0:
        f = False
        yn(f)
        continue
    if A[i] > A[i-k]:
        f =True
    else:
        f=False
    yn(f)
Buggy python submission (verdict: Runtime Error):
n = int(input())
import collections
co = collections.Counter()
for i in range(n):
    co[input()] +=1
print(f"AC x {co["AC"]}")
print(f"WA x {co["WA"]}")
print(f"TLE x {co["TLE"]}")
print(f"RE x {co["RE"]}")


Fixed submission:
n = int(input())
import collections
co = collections.Counter()
for i in range(n):
    s = input()
    co[s] +=1
print(f"AC x {co['AC']}")
print(f"WA x {co['WA']}")
print(f"TLE x {co['TLE']}")
print(f"RE x {co['RE']}")
Buggy python submission (verdict: Runtime Error):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
nmax = 10**6
mod = 10**9+7
fac = [1]*nmax
finv = [1]*nmax
inv = [1]*nmax
def ncr_pre():
    for i in range(2,nmax):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod%i] * (mod//i) %mod
        finv[i] = finv[i-1] * inv[i] %mod

def ncr(n,r):
    if n<r:
        return 0
    if n<0 or r<0:
        return 0
    return fac[n]* (finv[r] * finv[n-r] %mod) %mod

ncr_pre()
k = ni()
s = input()
n = len(s)
ans= 0
for i in range(k+1):
    ans=(ans+ ncr(n+k-i-1,n-1)*pow(25,k-i,mod)*pow(26,i,mod) )%mod
print(ans)


Fixed submission:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
nmax = 2*10**6+2
mod = 10**9+7
fac = [1]*nmax
finv = [1]*nmax
inv = [1]*nmax
def ncr_pre():
    for i in range(2,nmax):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod%i] * (mod//i) %mod
        finv[i] = finv[i-1] * inv[i] %mod

def ncr(n,r):
    if n<r:
        return 0
    if n<0 or r<0:
        return 0
    return fac[n]* (finv[r] * finv[n-r] %mod) %mod

ncr_pre()
k = ni()
s = input()
n = len(s)
ans= 0
for i in range(k+1):
    ans=(ans+ ncr(n+k-i-1,n-1)*pow(25,k-i,mod)*pow(26,i,mod) )%mod
print(ans)
Buggy python submission (verdict: Runtime Error):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd
a,b = input().split()
a = int(a)
b100 = 100*int(b[0]) + 10*int(b[1]) +int(b[2])

print(a*b100//100)


Fixed submission:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd
a,b = input().split()
a = int(a)
b100 = 100*int(b[0]) + 10*int(b[2]) +int(b[3])

print(a*b100//100)
Buggy python submission (verdict: Time Limit Exceeded):
##WA 和がSになる組み合わせを列挙しようとしたけど無理だった。
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd
mod = 998244353
n,s = ma()
A = list(ma())
dp = [[0]*(s+1) for i in range(n+1)]#dp[i][j]はi番目までの要素を用いてjになるような場合の数
dp[0][0] = 1
for i in range(n):
    a = A[i]
    for j in range(s+1):
        dp[i+1][j] =(dp[i][j]*2)%mod
        if a<=j:
            dp[i+1][j] = (dp[i][j-a] +dp[i+1][j]) %mod

print(dp[n][s])
#print(dp)


Fixed submission:
##WA 和がSになる組み合わせを列挙しようとしたけど無理だった。
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd
mod = 998244353
n,s = ma()
A = list(ma())
dp = [[0]*(s+1) for i in range(n+1)]#dp[i][j]はi番目までの要素を用いてjになるような場合の数
dp[0][0] = 1
for i in range(n):
    a = A[i]
    for j in range(s+1):
        dp[i+1][j] =(dp[i][j]*2)%mod
        if a<=j:
            dp[i+1][j] = (dp[i][j-a] +dp[i+1][j]) %mod

print(dp[n][s])
#print(dp)
Buggy python submission (verdict: Runtime Error):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys
gcd = math.gcd
co = collections.Counter()
n = ni()
mod=10**9+7
for i in range(n):
    a,b = ma()
    d = gcd(a,b)
    a//=d
    b//=d
    co[(a,b)]+=1
d = collections.defaultdict(lambda:False)
ans=1
for t,cnt in co.items():
    a,b = t
    if t==(0,0) or d[t]:
        continue
    d[(a,b)]=True;d[(-a,-b)]=True;d[(b,-a)]=True;d[(-b,a)]=True
    l1 = co[(a,b)]+co[(-a,-b)]
    l2 = co[(b,-a)]+co[(-b,a)]
    ans=ans*(pow(2,l1,mod)+pow(2,l2,mod) -1)%mod
    ans%=mod
print((ans-1)%mod)


Fixed submission:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys
gcd = math.gcd
co = collections.Counter()
n = ni()
mod=10**9+7
for i in range(n):
    a,b = ma()
    d = gcd(a,b)
    if d!=0:
        a//=d
        b//=d
    elif abs(a)>0 or abs(b)>0:
        l = max(abs(a), abs(b))
        a//=l
        b//=l
    co[(a,b)]+=1
d = collections.defaultdict(lambda:False)
ans=1
for t,cnt in co.items():
    a,b = t
    if t==(0,0) or d[t]:
        continue
    d[(a,b)]=True;d[(-a,-b)]=True;d[(b,-a)]=True;d[(-b,a)]=True
    l1 = co[(a,b)]+co[(-a,-b)]
    l2 = co[(b,-a)]+co[(-b,a)]
    ans=ans*(pow(2,l1,mod)+pow(2,l2,mod) -1)%mod
    ans%=mod
print((ans-1 +co[(0,0)])%mod)
Buggy python submission (verdict: Runtime Error):
comb = []
def f(n,cnt,ls):
    if cnt == n:
        comb.append(ls)
        return
    for i in range(ls[cnt-1],m+1):
        tmp = ls.copy()
        tmp[cnt] = i
        f(n,cnt+1,tmp)
    return
ma = lambda :map(int,input().split())
ni = lambda:int(input())

n,m,q = ma()
abcd = []
for i in range(q):
    abcd.append(list(ma()))
ls = [1]*(n+1)
f(n,0,ls)
ans = 0
for A in  comb:
    tmp = 0
    for a,b,c,d in abcd:
        if A[b-1] - A[a-1] ==c:
            tmp +=d
    ans = max(ans,tmp)
print(ans)


Fixed submission:
import collections
import math
import itertools
import sys
sys.setrecursionlimit(10**6)
def f(x):
  return (a*x)//b - a*(x//b)
ma = lambda :map(int,input().split())
ni = lambda:int(input())
a,b,n = ma()
if n>=b-1:
    print(f(b-1))
else:
    print(f(n))
Buggy python submission (verdict: Runtime Error):
n = int(input())
import math
print(2*math.pi()*n)


Fixed submission:
n = int(input())
import math
print(2*math.pi*n)

Buggy python submission (verdict: Runtime Error):
n = int(input())
import math
print(2*math.pi()*n)


Fixed submission:
n = int(input())
import math
print(2*math.pi*n)
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
gcd = fractions.gcd
ans = 0
k = int(input())
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            ans += gcd(i,gcd(j,l))
print(ans)


Fixed submission:
import math
gcd = math.gcd
ans = 0
k = int(input())
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            ans += gcd(i,gcd(j,l))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
gcd = math.gcd()
ans = 0
k = int(input())
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            ans += gcd(i,gcd(j,l))
print(ans)


Fixed submission:
import math
gcd = math.gcd
ans = 0
k = int(input())
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            ans += gcd(i,gcd(j,l))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
h,w,k =map(int,input().split())
ma = []
for i in range(h):
    ma.append(list(map(int,list(input()))))
ans = [0]*2**(h-1)
for i in range(2**(h-1)):
    idx = [0]*h #縦の何枚目か
    group = 0
    for j in range(h):
        idx[j] = group
        if (i>>j & 1):
            group +=1
    ans[i] += idx[-1]#h方向の分割
    n = idx[-1]+1#縦に何枚あるか
    cnt = [0]*n ##各ブロックの白チョコの数
    div_w = 0 #w方向の分割
    for e in range(w):
        temp = [0]*n #一時的な列を保存
        for j in range(h):
            p = idx[j]
            cnt[p] += ma[j][e]
            temp[p] += ma[j][e]
        if max(cnt) >k:
            div_w +=1
            cnt = temp
        if max(temp) >k:#この時h方向の分割そのものがだめ
            div_w = 10**9
            break
    ans[i] += div_w
print(min(ans))


Fixed submission:
h,w,k =map(int,input().split())
ma = []
for i in range(h):
    ma.append(list(map(int,list(input()))))
ans = [0]*2**(h-1)
for i in range(2**(h-1)):
    idx = [0]*h #縦の何枚目か
    group = 0
    for j in range(h):
        idx[j] = group
        if (i>>j & 1):
            group +=1
    ans[i] += idx[-1]#h方向の分割
    n = idx[-1]+1#縦に何枚あるか
    cnt = [0]*n ##各ブロックの白チョコの数
    div_w = 0 #w方向の分割
    for e in range(w):
        temp = [0]*n #一時的な列を保存
        for j in range(h):
            p = idx[j]
            cnt[p] += ma[j][e]
            temp[p] += ma[j][e]
        if max(cnt) >k:
            div_w +=1
            cnt = temp
        if max(temp) >k:#この時h方向の分割そのものがだめ
            div_w = 10**9
            break
    ans[i] += div_w
print(min(ans))
Buggy python submission (verdict: Time Limit Exceeded):
s  = input()
q  = int(input())
inv = 1
sfb = [0,"",""]
for i in range(q):
    ls = list(input().split())
    if ls[0] == "1":
        inv *=-1
    else:
        f,c = ls[1:]
        if f == "1":
            sfb[inv] +=c
        else:
            sfb[-inv] +=c

ans = sfb[1][::-1] + s + sfb[-1]
print(ans[::inv])


Fixed submission:
s  = input()
q  = int(input())
inv = 1
sfb = [0,"",""]
for i in range(q):
    ls = list(input().split())
    if ls[0] == "1":
        inv *=-1
    else:
        f,c = ls[1:]
        if f == "1":
            sfb[inv] +=c
        else:
            sfb[-inv] +=c

ans = sfb[1][::-1] + s + sfb[-1]
print(ans[::inv])
Buggy python submission (verdict: Time Limit Exceeded):
class SegmentTree():
    def __init__(self,n):
        self.e = 0
        self.r = 0 #ノードの段数
        cnt = 0
        while cnt<n:
            cnt=2**self.r
            self.r +=1
        self.tree = [self.e]*(2**self.r -1)# 0-index
        self.n = 2**(self.r-1) #一番下のnodeの数
    def func(self,a,b): #適宜書き換え
        return a|b
    def update(self,i,val):
        i += self.n -1
        self.tree[i] = val
        while i>0:
            i = (i-1)//2
            self.tree[i] = self.func(self.tree[i*2+1],self.tree[i*2+2])

    def query(self,l,r):
        l += self.n -1
        r += self.n -1 #開区間 idxはr-1
        lval = self.e
        rval = self.e
        while r>l:
            if l%2 == 0:
                lval = self.func(lval,self.tree[l])
                l+=1
            if r%2==0:
                rval = self.func(rval,self.tree[r-1])
                r-=1
            r//=2
            l//=2
        return self.func(lval,rval)
    def index(self,i):
        return i+self.n -1
def sid(s):
    return ord(s)-ord("a") #chr("a") == 0

import sys
input = sys.stdin.readline
n = int(input())
S = input()[:-1]
Q = int(input())
seg = SegmentTree(n)
for i in range(n):
    s = S[i]
    seg.update(i,2**(sid(s)))
for q in range(Q):
    num,a,b = input().split()
    if num=="1":
        seg.update(int(a)-1,2**sid(b))
        #print(a,b,list(map(lambda x:bin(x)[2:],seg.tree)))
    else:
        print(bin(seg.query(int(a)-1,int(b))).count("1"))


Fixed submission:
class SegmentTree():
    def __init__(self,n):
        self.e = 0
        self.r = 0 #ノードの段数
        cnt = 0
        while cnt<n:
            cnt=2**self.r
            self.r +=1
        self.tree = [self.e]*(2**self.r -1)# 0-index
        self.n = 2**(self.r-1) #一番下のnodeの数
    def func(self,a,b): #適宜書き換え
        return a|b
    def update(self,i,val):
        i += self.n -1
        self.tree[i] = val
        while i>0:
            i = (i-1)//2
            self.tree[i] = self.func(self.tree[i*2+1],self.tree[i*2+2])

    def query(self,l,r):
        l += self.n -1
        r += self.n -1 #開区間 idxはr-1
        lval = self.e
        rval = self.e
        while r>l:
            if l%2 == 0:
                lval = self.func(lval,self.tree[l])
                l+=1
            if r%2==0:
                rval = self.func(rval,self.tree[r-1])
                r-=1
            r//=2
            l//=2
        return self.func(lval,rval)
    def index(self,i):
        return i+self.n -1
def sid(s):
    return ord(s)-ord("a") #chr("a") == 0

import sys
input = sys.stdin.readline
n = int(input())
S = input()[:-1]
Q = int(input())
seg = SegmentTree(n)
for i in range(n):
    s = S[i]
    seg.update(i,2**(sid(s)))
for q in range(Q):
    num,a,b = input().split()
    if num=="1":
        seg.update(int(a)-1,2**sid(b))
        #print(a,b,list(map(lambda x:bin(x)[2:],seg.tree)))
    else:
        print(bin(seg.query(int(a)-1,int(b))).count("1"))
Buggy python submission (verdict: Runtime Error):
nmax = 10**6+1
mod = 10**9+7

fac = [1]*nmax
finv = [1]*nmax
inv = [1]*nmax
def ncr_pre():
    for i in range(2,nmax):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod%i] * (mod//i) %mod
        finv[i] = finv[i-1] * inv[i] %mod

def ncr(n,r):
    if n<r:
        return 0
    if n<0 or r<0:
        return 0
    return fac[n]* (finv[r] * finv[n-r] %mod) %mod

ncr_pre()
r1,c1,r2,c2 = map(int,input().split())

ans = 0
for c in range(c1,c2+1):
    for r in range(r1,r2+1):
        ans+=ncr(r+c,c)
        ans %=mod
print(ans)


Fixed submission:
nmax = (10**6+1)*2
mod = 10**9+7

fac = [1]*nmax
finv = [1]*nmax
inv = [1]*nmax
def ncr_pre():
    for i in range(2,nmax):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod%i] * (mod//i) %mod
        finv[i] = finv[i-1] * inv[i] %mod

def ncr(n,r):
    if n<r:
        return 0
    if n<0 or r<0:
        return 0
    return fac[n]* (finv[r] * finv[n-r] %mod) %mod

def g(r,c):## r以下かつc以下の経路f(i,j)の総和
    ans = 0
    for i in range(1,r+2):
        ## f(i+1,c) =  f(i,0) + f(i,1) + ...f(i,c)
        ans += ncr(i+c,c)
        ans %=mod
    return ans

ncr_pre()
r1,c1,r2,c2 = map(int,input().split())
ans = g(r2,c2) - g(r1-1,c2) - g(r2,c1-1) + g(r1-1,c1-1)
print(ans % mod)
Buggy python submission (verdict: Runtime Error):
3 1
4 1 5

Fixed submission:
n,k = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
if k>=n:
    print(0)
else:
    print(sum(H[0:n-k]))
Buggy python submission (verdict: Runtime Error):
ma = lambda :map(int,input().split())

n,a,b = ma()
if (b-a)%2 ==0:
    print((b-a)//2)
else:
    print(min(a+ (b-a-1)//2, (n-b+1)+(b-a-1)//2)


Fixed submission:
ma = lambda :map(int,input().split())

n,a,b = ma()
if (b-a)%2 ==0:
    print((b-a)//2)
else:
    print(min(a+ (b-a-1)//2, (n-b+1)+(b-a-1)//2))
Buggy python submission (verdict: Runtime Error):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
gcd = math.gcd
a,b = ma()
print(a*b//gcd(a,b))


Fixed submission:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
import collections
import math
import itertools
import fractions
gcd = fractions.gcd
a,b = ma()
print(a*b//gcd(a,b))
Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9+7
n = int(input())
A = list(map(int,input().split()))
c01 = [[0,0] for i in range(60)]
for a in A:
    for j in range(60):
        if a>>j &1:
            c01[j][1] += 1
        else:
            c01[j][0] += 1
ans = 0
for i in range(60):
    ans += 2**i *c01[i][0]*c01[i][1]
    ans%=mod
print(ans)


Fixed submission:
mod = 10**9+7
n = int(input())
A = list(map(int,input().split()))
c01 = [[0,0] for i in range(60)]
for a in A:
    for j in range(60):
        if a>>j &1:
            c01[j][1] += 1
        else:
            c01[j][0] += 1
ans = 0
for i in range(60):
    ans += 2**i *c01[i][0]*c01[i][1]
    ans%=mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n,m,l = ma()
INF=10**15
cost = [[-1]*n for i in range(n)]
tree = [[] for i in range(n)]
for i in range(m):
    a,b,c = ma();a-=1;b-=1
    tree[a].append((c,b))
    tree[b].append((c,a))

def Dijkstra(graph,s):
    heap = [(0,l,s)] #スタートから距離が近い順に訪問
    rest = [INF]*n
    rest[s]=0
    while heap:
        cost,fuel,node = hq.heappop(heap)
        if cost>rest[node]:continue
        for w,nex in graph[node]:
            if fuel>=w:
                rest[nex]=min(cost,rest[nex])
                hq.heappush(heap,(cost,fuel-w,nex))
            else:
                if l<w:
                    pass
                else:
                    rest[nex]=min(cost+1,rest[nex])
                    hq.heappush(heap,(cost+1,l-w,nex))
    #print(s,rest)
    return rest
q = ni()
for i in range(q):
    s,t = ma();s-=1;t-=1
    if s>t:s,t=t,s
    if cost[s][t]==-1:
        cost[s] = Dijkstra(tree,s)

    print(cost[s][t]) if cost[s][t] !=INF else print(-1)


Fixed submission:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n,m,l = ma()
INF=10**15
cost = [[INF]*n for i in range(n)]
for i in range(m):
    a,b,c = ma();a-=1;b-=1
    cost[a][b]=c
    cost[b][a]=c

def wf(cost):
    l = len(cost[0])
    for k in range(l):
        for i in range(l):
            for j in range(l):
                cost[i][j] =  min(cost[i][j],cost[i][k] + cost[k][j])
wf(cost)
rest = [[INF]*n for i in range(n)]
for i in range(n):
    for j in range(n):
        if cost[i][j]<=l:
            rest[i][j]=1
wf(rest)
q = ni()
for i in range(q):
    s,t = ma();s-=1;t-=1
    print(rest[s][t] -1) if rest[s][t] !=INF else print(-1)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
H = list(map(int,input().split()))
cnt = 0
H.sort(reverse=True))
for h in H :
    if h >=k:
        cnt+=1
print(cnt)


Fixed submission:
n,k = map(int,input().split())
H = list(map(int,input().split()))
cnt = 0
H.sort(reverse=True)
for h in H :
    if h >=k:
        cnt+=1
print(cnt)