Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
IN = iter(Input.split('\n')).__next__
def input():
    return IN()

# 入力
from collections import deque
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
p += [0]
q = list(map(int, input().split()))
q += [0]
r = list(map(int, input().split()))
r += [0]
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
n, m, l = 0, 0, 0
ans = 0
for i in range(x+y):
    if (p[n] >= r[l] or q[n] >= r[l]) and n < x and m < y:
        if p[n] >= q[m]:
            ans += p[n]
            n += 1
        else:
            ans += q[m]
            m += 1
    elif n == x:
        if q[m] >= r[l]:
            ans += q[m]
            m += 1
        else:
            ans += r[l]
            m += 1
            l += 1
    elif m == y:
        if p[n] >= r[l]:
            ans += p[n]
            n += 1
        else:
            ans += r[l]
            n += 1
            l += 1    
    else:
        if p[n] >= q[m]:
            ans += r[l]
            m += 1
            l += 1
        else:
            ans += r[l]
            n += 1
            l += 1
print(ans)

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
ans = r
for i in range(x):
    ans.append(p[i])
for i in range(y):
    ans.append(q[i])
r.sort(reverse=True)
print(sum(ans[:x+y]))
Buggy python submission (verdict: Time Limit Exceeded):
import math, collections
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
a = list(map(int, input().split()))
al = collections.Counter(a)
res = [0]*(n+1)
dp = [0]*(n+1)
for i in al:
    if al[i]==1: 
        continue
    if dp[al[i]] == 0:
        res[i] += combinations_count(al[i], 2)
        dp[al[i]] += res[i]
    else: res[i] = dp[al[i]]
sum_ = sum(res)
for i in a:
    if al[i]==1:
        print(sum_)
        continue
    if al[i]==2:
        print(sum_-res[i])
        continue
    if dp[al[i]-1] == 0:
        dp[al[i]-1] = combinations_count(al[i]-1, 2)
        print(sum_-res[i]+ dp[al[i]-1])
    else: print(sum_-res[i]+ dp[al[i]-1])

Fixed submission:
import math, collections
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
a = list(map(int, input().split()))
al = collections.Counter(a)
res = [0]*(n+1)
dp = [0]*(n+1)
for i in al:
    if al[i]==1: 
        continue
    if dp[al[i]] == 0:
        res[i] += combinations_count(al[i], 2)
        dp[al[i]] += res[i]
    else: res[i] = dp[al[i]]
sum_ = sum(res)
for i in a:
    if al[i]==1:
        print(sum_)
        continue
    if al[i]==2:
        print(sum_-res[i])
        continue
    if dp[al[i]-1] == 0:
        dp[al[i]-1] = combinations_count(al[i]-1, 2)
        print(sum_-res[i]+ dp[al[i]-1])
    else: print(sum_-res[i]+ dp[al[i]-1])

Buggy python submission (verdict: Time Limit Exceeded):
import math, collections
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
a = list(map(int, input().split()))
al = collections.Counter(a)
res = [0]*(n+1)
for i in al:
    if al[i]==1:
        continue
    res[i] += combinations_count(al[i], 2)
sum_ = sum(res)
for i in a:
    if al[i]==1:
        print(sum_)
        continue
    if al[i]==2:
        print(sum_-res[i])
        continue
    print(sum_-res[i]+ combinations_count(al[i]-1, 2))

Fixed submission:
import math, collections
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
a = list(map(int, input().split()))
al = collections.Counter(a)
res = [0]*(n+1)
dp = [0]*(n+1)
for i in al:
    if al[i]==1: 
        continue
    if dp[al[i]] == 0:
        res[i] += combinations_count(al[i], 2)
        dp[al[i]] += res[i]
    else: res[i] = dp[al[i]]
sum_ = sum(res)
for i in a:
    if al[i]==1:
        print(sum_)
        continue
    if al[i]==2:
        print(sum_-res[i])
        continue
    if dp[al[i]-1] == 0:
        dp[al[i]-1] = combinations_count(al[i]-1, 2)
        print(sum_-res[i]+ dp[al[i]-1])
    else: print(sum_-res[i]+ dp[al[i]-1])
Buggy python submission (verdict: Runtime Error):
IN = iter(Input.split('\n')).__next__
def input():
    return IN()

# 入力
h, w, k = map(int, input().split())
s = []
for _ in range(h):
    s_ = [int(i) for i in input()]
    s.append(s_)
ans = float("INF")
for i in range(2**(h-1)):
    d = [(i >> j) & 1 for j in range(h-1)]
    count, count_tmp = [0]*(sum(d)+1), [0]*(sum(d)+1)
    ans_, res = 0, 0
    flag = False
    for w_ in range(w):
        count[0] += s[0][w_]
        count_tmp[0] += s[0][w_]
        res += 1
        tmp = 0
        for h_ in range(1, h):
            if d[h_-1]: tmp += 1
            if s[h_][w_]:
                count[tmp] += 1
                count_tmp[tmp] += 1
        for j in count:
            if j > k:
                if res==1:
                    flag = True
                    break
                else:
                    for idx in range(sum(d)+1):
                        count[idx] = count_tmp[idx]
                    ans_ += 1
                    res = 0
                    break
        if flag: break
        count_tmp = [0]*(sum(d)+1)
    ans_ += sum(d)
    ans = min(ans, ans_)
print(ans)

Fixed submission:
h, w, k = map(int, input().split())
s = [[int(i) for i in input()] for _ in range(h)]
ans = (h-1)+(w-1)
for i in range(2**(h-1)):
    d = [(i >> j) & 1 for j in range(h-1)]
    count, count_tmp = [0]*(sum(d)+1), [0]*(sum(d)+1)
    ans_, res = 0, 0
    flag = False
    for w_ in range(w):
        count[0] += s[0][w_]
        count_tmp[0] += s[0][w_]
        res += 1
        tmp = 0
        for h_ in range(1, h):
            if d[h_-1]: tmp += 1
            if s[h_][w_]:
                count[tmp] += 1
                count_tmp[tmp] += 1
        for j in count:
            if j > k:
                if res==1:
                    flag = True
                    break
                else:
                    for idx in range(sum(d)+1):
                        count[idx] = count_tmp[idx]
                    ans_ += 1
                    res = 1
                    break
        if flag: break
        count_tmp = [0]*(sum(d)+1)
    if flag: continue
    ans_ += sum(d)
    ans = min(ans, ans_)
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(float, input().split())
if c-a-b>0 and 4*ab<(c-a-b)**2
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c=map(int,input().split())
if c-a-b>0 and (c-a-b)**2>4*a*b:  
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a, b, c = map(float, input().split())
if c-a-b>0 and 4ab<(c-a-b)**2
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c=map(int,input().split())
if c-a-b>0 and (c-a-b)**2>4*a*b:  
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
mod = 10**9+7
ans = 2**n-1%mod
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

N = 10**4
g1 = [1, 1] 
g2 = [1, 1] 
inverse = [0, 1] 

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
a = 0
a += cmb(n,b,mod) 
a += cmb(n,b,mod) 
print((ans-a)%mod)

Fixed submission:
n, a, b = map(int, input().split())
m = 10**9+7
def cmb(r):
    N = 1
    R = 1
    for i in range(r):
        N = N*(n - i) % m
        R = R*(i+1) % m
    return N*pow(R, m-2, m)%m

ans = (pow(2, n, m) - ((cmb(a) + cmb(b) + 1)%m))%m
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    for j in range(i+1, n):
        if a[i] == a[j]:
             print("NO")
             exit()
print("YES")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = False
for i in range(len(a)-1):
    if a[i] == a[i+1]:
        flag = True
        break
if flag:
    print("NO")
else:
    print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = -1

for i in range(len(p)):
    p[i] = 0.5*(p[i]+1)
for i in range(len(p)-k+1):
    sum_ = sum(p[i:i+k])
    ans = max(ans, sum_)
print(ans)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
d = [0 for _ in range(n)]

for i in range(len(p)):
    p[i] = 0.5*(p[i]+1)
d[0] = sum(p[0:k])
for i in range(1, n-k+1):
    d[i] = d[i-1] + p[i+k-1] -p[i-1]
print(max(d))

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

for i in range(len(p)):
    p[i] = 0.5*(p[i]+1)
for i in range(k-1, len(p)):
    sum_ = 0
    for j in range(k):
        sum_ += p[i-j]
    ans = max(ans, sum_)
print(ans)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
d = [0 for _ in range(n)]

for i in range(len(p)):
    p[i] = 0.5*(p[i]+1)
d[0] = sum(p[0:k])
for i in range(1, n-k+1):
    d[i] = d[i-1] + p[i+k-1] -p[i-1]
print(max(d))
Buggy python submission (verdict: Runtime Error):
n, d, a = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
A.sort()
count = 0
for i in range(n):
    if A[i][1] > 0:
        sx = A[i][0]
        if A[i][1] % a == 0:
            count_a = A[i][1] // a
        else:
            count_a = A[i][1] // a +1
        A[i][1] -= count_a * a
        count += count_a
        for j in range(i+1, n):
            if A[j][1] > sx + d*2:
                break
            else:
                A[j][1] -= count_a * a
print(count)

Fixed submission:
h, a = map(int, input().split())
count = 1
count += h // a
if h % a == 0:
    count -= 1
print(count)
Buggy python submission (verdict: Runtime Error):
h, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(k)]
dp = [0 for i in range(h+1)]
for i in range(1, h+1):
    dp[i] = min(dp[i - a]+b for a,b in ab)
print(min(dp[h:]))

Fixed submission:
h, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(k)]
maxa = max(a for a,b in ab)
dp = [0 for i in range(h+maxa)]
for i in range(1, h+maxa):
    dp[i] = min(dp[i - a]+b for a,b in ab)
print(min(dp[h:]))

Buggy python submission (verdict: Runtime Error):
h, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(k)]
dp = [0 for i in range(10**3+1)]
for i in range(1, h+1):
    dp[i] = min(dp[i - a]+b for a,b in ab)
print(dp[h])

Fixed submission:
h, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(k)]
maxa = max(a for a,b in ab)
dp = [0 for i in range(h+maxa)]
for i in range(1, h+maxa):
    dp[i] = min(dp[i - a]+b for a,b in ab)
print(min(dp[h:]))

Buggy python submission (verdict: Runtime Error):
h, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(k)]
dp = [0 for i in range(h+1)]
for i in range(1, h+1):
    dp[i] = min(dp[i - a]+b for a,b in ab)
print(dp[h])

Fixed submission:
h, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(k)]
maxa = max(a for a,b in ab)
dp = [0 for i in range(h+maxa)]
for i in range(1, h+maxa):
    dp[i] = min(dp[i - a]+b for a,b in ab)
print(min(dp[h:]))

Buggy python submission (verdict: Runtime Error):
h, k = map(int, input().split())
a = []
b = []
for i in range(k):
    a_, b_ = map(int, input().split())
    a.append(a_)
    b.append(b_)
dp = [0 for _ in range(h+1)]

for i in range(1, h+1):
    m0 = dp[i-a[0]] + b[0]
    for j in range(1, len(a)):
        m = dp[i-a[j]] + b[j]
        m0 = min(m, m0)
    dp[i] = m0

print(dp[h])

Fixed submission:
h, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(k)]
maxa = max(a for a,b in ab)
dp = [0 for i in range(h+maxa)]
for i in range(1, h+maxa):
    dp[i] = min(dp[i - a]+b for a,b in ab)
print(min(dp[h:]))

Buggy python submission (verdict: Runtime Error):
h, k = map(int, input().split())
a = []
b = []
for i in range(k):
    a_, b_ = map(int, input().split())
    a.append(a_)
    b.append(b_)
dp = [0 for _ in range(h+1)]

for i in range(h+1):
    m0 = dp[i-a[0]] + b[0]
    for j in range(1, len(a)):
        m = dp[i-a[j]] + b[j]
        m0 = min(m, m0)
    dp[i] = m0

print(dp[h])

Fixed submission:
h, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(k)]
maxa = max(a for a,b in ab)
dp = [0 for i in range(h+maxa)]
for i in range(1, h+maxa):
    dp[i] = min(dp[i - a]+b for a,b in ab)
print(min(dp[h:]))
Buggy python submission (verdict: Time Limit Exceeded):
n, d, a = map(int, input().split())
xh = [list(map(int, input().split())) for _ in range(n)]
xh.sort(key=lambda x:x[0])
count = 0
for i in range(n):
    while xh[i][1] > 0:
        r = xh[i][0] + d*2
        atack = -(-xh[i][1]//a)
        xh[i][1] = 0
        count += atack
        if i > n-1: continue
        j = i
        while True:
            j += 1
            if j<n and r>=xh[j][0]: xh[j][1] -= atack*a
            else: break
print(count)

Fixed submission:
from collections import deque
n, d, a = map(int, input().split())
xh = [list(map(int, input().split())) for i in range(n)]
xh.sort()
que = deque()
ans = 0
atk = 0
for x, h in xh:
    while que and que[0][0] <= x:
        atk -= que.popleft()[1]
    h -= a*atk
    if h <= 0:
        continue
    count = -(-h//a)
    ans += count
    atk += count
    que.append((x+2*d+1, count))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, d, a = map(int, input().split())
xh = [list(map(int, input().split())) for _ in range(n)]
xh.sort(key=lambda x:x[0])
count = 0
for i in range(n):
    while xh[i][1] > 0:
        r = xh[i][0] + d*2
        atack = -(-xh[i][1]//a)
        xh[i][1] = 0
        count += atack
        if i > n-1: continue
        j = i
        while True:
            j += 1
            if j<n and r>=xh[j][0]: xh[j][1] -= atack*a
            else: break
print(count)

Fixed submission:
from collections import deque
n, d, a = map(int, input().split())
xh = [list(map(int, input().split())) for i in range(n)]
xh.sort()
que = deque()
ans = 0
atk = 0
for x, h in xh:
    while que and que[0][0] <= x:
        atk -= que.popleft()[1]
    h -= a*atk
    if h <= 0:
        continue
    count = -(-h//a)
    ans += count
    atk += count
    que.append((x+2*d+1, count))
print(ans)

Buggy python submission (verdict: Runtime Error):
n, d, a = map(int, input().split())
x = []
h = []
for i in range(n):
    x_, h_ = map(int, input().split())
    x.append(x_)
    h.append(h_)
n_list = range(max(x))

count = 0
j = 0

for i in range(n):
    if x[i] > 0:
        print(h)
        s = x[i]
        bakuha = (h[i]//a)
        h[i] = 0
        count += bakuha
        if i < n-1:
            j = i+1
            while x[j] <= s+(2*d):
                h[j] -= bakuha*a
                if j < n-1:
                    j += 1
                    if h[j] <= 0:
                        h[j] = 0
                        break
                else:
                    break
print(count)



Fixed submission:
from collections import deque
n, d, a = map(int, input().split())
xh = [list(map(int, input().split())) for i in range(n)]
xh.sort()
que = deque()
ans = 0
atk = 0
for x, h in xh:
    while que and que[0][0] <= x:
        atk -= que.popleft()[1]
    h -= a*atk
    if h <= 0:
        continue
    count = -(-h//a)
    ans += count
    atk += count
    que.append((x+2*d+1, count))
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a < b:
    print(f"{a}"*b)
elif a >= b:
    print(f"{b}"*a)

Fixed submission:
a, b = map(str, input().split())
if int(a) < int(b):
    print("{}".format(a)*int(b))
else:
    print("{}".format(b)*int(a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
p_list = [True for i in range(n)]
for i in range(1,n):
    for j in range(i):
        if p[i] > p[j]:
            p_list[i] = False
            break
print(p_list.count(True))

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
q = p[0]
count = 1
for i in range(1,n):
    if q > p[i]:
        count += 1
    q = min(q, p[i])
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]
ans = 0
for i in range(1, n):
    lcm = lcm * a[i] // fractions.gcd(lcm, a[i])
for i in range(0, n):
    ans += lcm//a[i]
print(ans%(10**9+7))

Fixed submission:
import fractions
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]
ans = 0
for i in range(1, n):
    lcm = lcm * a[i] // fractions.gcd(lcm, a[i])
for i in range(0, n):
    ans += lcm//a[i]
print(ans%(10**9+7))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a_list = []
b_list = ["f"] * (10**5+1)
count_ac = 0
count_wa = 0
for i in range(m):
    a,b = map(str, input().split())
    a_list.append((int(a),b))
for i in range(m):
    if a_list[i][1] == "WA" and b_list[a_list[i][0]] == "f":
        count_wa += 1
    if a_list[i][1] == "AC":
        if b_list[a_list[i][0]] == "f":
            count_ac += 1
        b_list[a_list[i][0]] = "t"
for i in range(m):
    if b_list[a_list[i][0]] == "f" and b_list[a_list[i][1]] == "WA":
        count_wa -= 1
print(count_ac,count_wa)

Fixed submission:
n, m = map(int, input().split())
a_list = []
b_list = ["f"] * (10**5+1)
count_ac = 0
count_wa = 0
for i in range(m):
    a,b = map(str, input().split())
    a_list.append((int(a),b))
for i in range(m):
    if a_list[i][1] == "WA" and b_list[a_list[i][0]] == "f":
        count_wa += 1
    if a_list[i][1] == "AC":
        if b_list[a_list[i][0]] == "f":
            count_ac += 1
        b_list[a_list[i][0]] = "t"
for i in range(m):
    if b_list[a_list[i][0]] == "f" and a_list[i][1] == "WA":
        count_wa -= 1
print(count_ac,count_wa)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans = []
for i in itertools.combinations(a,k):
    ans.append(max(i)-min(i))
print(sum(ans)%((10**9)+7))

Fixed submission:
def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
 
mod = 10**9+7  
nums = 10**5 # 制約に合わせよう
g1, g2, inverse = [1, 1] , [1, 1], [0, 1]
 
for num in range(2, nums + 1):
    g1.append((g1[-1] * num) % mod)
    inverse.append((-inverse[mod % num] * (mod//num)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

ans = 0
for i in range(n):
    res = cmb(n-i-1, k-1, mod)
    ans += res*a[n-i-1] - res*a[i]
    ans %= mod
print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions

n, m = map(int, input().split())
a = list(map(int, input().split()))
b = []
for i in a:
    b_ = i//2
    b.append(b_)
count = 0
flag = True

while res % 2 != 0:
    res = a[0]/2
    count += 1
for i in a:
    if i % 2**count != 0:
        flag = False
        break
if flag:    
    lcm = b[0]
    for i in range(1, len(b)):
        lcm = lcm*b[i]//fractions.gcd(lcm,b[i])
    ans = m // lcm - (m//(lcm*2))
    print(ans)
else:
    print(0)

Fixed submission:
import fractions
import sys
n, m = map(int, input().split())
a = list(map(int, input().split()))
lcm = a[0]
for i in range(1, len(a)):
    lcm = lcm*a[i]//fractions.gcd(lcm,a[i])
for i in a:
    if(lcm//i)%2 == 0:
        print(0)
        sys.exit()
lcm //= 2
print(m//lcm-(m//(lcm*2)))
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for _ in range(k):
    if a != 0:
        a -= 1
    else:
        b -= 1
print(a,b)

Fixed submission:
a, b, k = map(int, input().split())
if k >= a + b:
    a = 0
    b = 0
elif a <= k:
    b = b + a - k
    a = 0
else:
    a -= k
print(a,b)
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 0
if abs(a-b)%2:
    if max(a, b)-1 >  n-min(a, b):
        if a > b:
            pirnt(n-a+abs(n-(b+n-a)))
        else:
            pirnt(n-b+abs(n-(a+n-b)))
    else:
        if a > b:
            print(b-1+abs(1-(a-b+1)))
        else:
            print(a-1+abs(1-(b-a+1)))
else:
    print(abs(a-b)//2)

Fixed submission:
n, a, b = map(int, input().split())
if abs(a-b)%2:
    if b>a: a, b = b, a
    print(min(a-1, n-b)+1+(b-a-1)//2)
else:
    print(abs(a-b)//2)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if (A == 1and B == 2) or  (A == 2 and B == 1):
    print(3)
elif (A == 1 and B == 3) or (A == 3 and B == 1):
     print(2)
elif (A == 2 and B == 3) or (A == 1 and B == 3)
    print(3)

Fixed submission:
A = int(input())
B = int(input())
if (A == 1and B == 2) or  (A == 2 and B == 1):
    print(3)
elif (A == 1 and B == 3) or (A == 3 and B == 1):
     print(2)
elif (A == 2 and B == 3) or (A == 3 and B == 2):
    print(1)
Buggy python submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
print(a * b // math.gcd(a, b))

Fixed submission:
import fractions

a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))

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

a, b = map(int, input().split())
print(int(a * b / math.gcd(a, b)))

Fixed submission:
import fractions

a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()] , dtype=np.int64)
a_ = list(map(int, input().split()))
m = 10**9+7
ans = 0
for k in range(60):
    b = (a>>k) & 1
    res = np.count_nonzero(b)
    ans += res*(n-res)*2**k
print(ans%m)

Fixed submission:
import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()] , dtype=np.int64)
m = 10**9+7
ans = 0
for k in range(60):
    b = (a>>k) & 1
    res = np.count_nonzero(b)
    ans += res*(n-res)*2**k
print(ans%m)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
a = np.array([], dtype=np.int64)
a_ = list(map(int, input().split()))
for i in a_:
    a = np.append(a, i)
m = 10**9+7
ans = 0
for k in range(0, 61):
    b = (a>>k) & 1
    res = np.count_nonzero(b)
    ans += res*(n-res)*2**k
print(ans%m)

Fixed submission:
import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()] , dtype=np.int64)
m = 10**9+7
ans = 0
for k in range(60):
    b = (a>>k) & 1
    res = np.count_nonzero(b)
    ans += res*(n-res)*2**k
print(ans%m)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
n_list = list(map(int, input().split()))
n_sum = 0
for i in range(N):
    for j in range(0, i):
        n_sum += n_list[i] ^ n_list[j]
print(n_sum % (10**9 + 7))

Fixed submission:
import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()] , dtype=np.int64)
m = 10**9+7
ans = 0
for k in range(60):
    b = (a>>k) & 1
    res = np.count_nonzero(b)
    ans += res*(n-res)*2**k
print(ans%m)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
n_list = list(map(int, input().split()))
n_sum = 0
for i in range(N):
    for j in range(0, i):
        n_sum += n_list[i] ^ n_list[j]
print(n_sum % (10**9 + 7))

Fixed submission:
import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()] , dtype=np.int64)
m = 10**9+7
ans = 0
for k in range(60):
    b = (a>>k) & 1
    res = np.count_nonzero(b)
    ans += res*(n-res)*2**k
print(ans%m)