Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from itertools import accumulate

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

acc1 = list(accumulate(A))
acc2 = list(accumulate(B))

def is_ok(a, b):
    if acc1[a] + acc2[b] <= K:  return 1
    return 0

def binary_search(i, left, right):
    while (abs(right - left) > 1):
        mid = (left + right) // 2
        if is_ok(i, mid):  right = mid
        else:  left = mid
    return right

ans = 0
for i in range(N):
    ret = binary_search(i, M, -1)
    if ret == -1:  
      if acc1[i] <= K:  ans = max(i + 1, ans)
    else:
      ans = max(ans,  i + ret + 2)
      
acc1, acc2 = acc2, acc1
      
for i in range(N):
    ret = binary_search(i, M, -1)
    if ret == -1:  
      if acc1[i] <= K:  ans = max(i + 1, ans)
    else:
      ans = max(ans,  i + ret + 2)
      
print(ans)

Fixed submission:
from itertools import accumulate

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

acc1 = list(accumulate(A))
acc2 = list(accumulate(B))

def is_ok(a, b):
    if acc1[a] + acc2[b] <= K:  return 1
    return 0

def binary_search(i, left, right):
    while (abs(right - left) > 1):
        mid = (left + right) // 2
        if is_ok(i, mid):  right = mid
        else:  left = mid
    return right

ans = 0
for i in range(N):
    ret = binary_search(i, M, -1)
    if ret == -1:  
      if acc1[i] <= K:  ans = max(i + 1, ans)
    else:
      ans = max(ans,  i + ret + 2)
      
acc1, acc2 = acc2, acc1
N, M = M, N
      
for i in range(N):
    ret = binary_search(i, M, -1)
    if ret == -1:  
      if acc1[i] <= K:  ans = max(i + 1, ans)
    else:
      ans = max(ans,  i + ret + 2)
      
print(ans)
Buggy python submission (verdict: Runtime Error):
def num2alpha(num):
    if num <= 26:  return chr(64 + num)
    elif num % 26 == 0:  return num2alpha(num // 26 - 1) + chr(90)
    return num2alpha(num // 26) + chr(64  num % 26)

N = int(input())
ans = num2alpha(N).lower()
print(ans)

Fixed submission:
N = int(input())
d = "abcdefghijklmnopqrstuvwxyz"
ans = ""
N -= 1

while(N >= 0):
    ans += d[N % 26]
    N //= 26
    N -= 1
    
print(ans[::-1])
Buggy python submission (verdict: Runtime Error):
X = int(input)

ans = 0
while(1):
  ans += 1
  if (X * ans) % 360 == 0:
    print(ans)
    break

Fixed submission:
X = int(input())
 
ans = 0
while(1):
  ans += 1
  if (X * ans) % 360 == 0:
    print(ans)
    break

Buggy python submission (verdict: Runtime Error):
print(360 // int(input))

Fixed submission:
X = int(input())
 
ans = 0
while(1):
  ans += 1
  if (X * ans) % 360 == 0:
    print(ans)
    break
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#define INF (1e9 + 7)
#define distance(x1, y1, x2, y2) sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
typedef long long ll;
using namespace std;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vs = vector<string>;
using vvs = vector<vector<string>>;
int main(){
    
    ll A;
    double B;
    cin >> A >> B;
    ll ans = A * B;
    cout << ans << endl;

    return 0;
}

Fixed submission:
from decimal import Decimal
in_ = list(input().split())
A = int(in_[0])
B = Decimal(in_[1])
ans = Decimal(A * B)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#define INF (1e9 + 7)
#define distance(x1, y1, x2, y2) sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
typedef long long int ll;
using namespace std;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vs = vector<string>;
using vvs = vector<vector<string>>;
int main(){
    
    string S;
    cin >> S;
    reverse(S.begin(), S.end());
    int length = S.size();
    string T = "";

    if(S[0] == '?'){
        T.push_back('D');
    }
    else{
        T.push_back(S[0]);
    }

    rep2(i, 1, length){
        if(S[i] == '?'){     
            if(T.back() == 'D'){
                T.push_back('P');
            }
            else{
                T.push_back('D');
            }
        }
        else{
            T.push_back(S[i]);
        }
    }

    reverse(T.begin(), T.end());
    cout << T <<endl;

    return 0;
}

Fixed submission:
S = input()
S = S.replace("?", "D")
print(S)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()[::-1]
length = len(S)
T = []

if S[0] == "?":
    T.append("D")
else:
    T.append(S[0])

for i in range(1, length):
    if S[i] == "?":           
        if T[-1] == "D":
            T.append("P")
        else:
            T.append("D")
    else:
        T.append(S[i])

ans = ""
T = T[::-1]
for i in range(length):
    ans += T[i]
print(ans)

Fixed submission:
S = input()
S = S.replace("?", "D")
print(S)
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
for i in range(N):
    A[i] -= 1
    
visited = [-1] * N
visited[0] = 0
ret = [0]
next_ = A[0]

for i in range(1, K):
    if visited[next_] != -1:
        roop_start = visited[next_]
        break
    ret.append(next_)
    visited[next_] = i
    next_ = A[next_]
    
if K <= roop_start:
    print(ret[K])
else:
    roop_length = len(ret) - roop_start
    mod = (K - roop_start) % roop_length
    print(ret[roop_start + mod] + 1)

Fixed submission:
N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
for i in range(N):
    A[i] -= 1
    
visited = [-1] * N
visited[0] = 0
ret = [0]
next_ = A[0]
roop_start = 10 ** 9 + 7

for i in range(1, K + 1):
    if visited[next_] != -1:
        roop_start = visited[next_]
        break
    ret.append(next_)
    visited[next_] = i
    next_ = A[next_]
    
if K <= roop_start:
    print(ret[K] + 1)
else:
    roop_length = len(ret) - roop_start
    mod = (K - roop_start) % roop_length
    print(ret[roop_start + mod] + 1)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

def cin():  return list(map(int,input().split()))

def cmb(n, r):
    INF = 998244353
    r = min(n - r, r)
    if r == 0:  return 1
    numer = reduce(lambda x, y: (x * y) % INF, range(n, n - r, -1))
    denom = reduce(lambda x, y: (x * y) % INF, range(1, r + 1))
    return (numer * pow(denom, INF - 2, INF)) % INF

N, M, K = cin()
ans = 0
for i in range(K + 1):
    ans += M * cmb(N - 1, i) * pow(M - 1, N - 1 - i, 998244353)
    ans %= 998244353
print(ans)

Fixed submission:
from functools import reduce

def cin():  return list(map(int,input().split()))
N, M, K = cin()
MOD = 998244353

fac = [1] * (N + 1)
inv = [1] * (N + 1)

for j in range(1, N + 1):  fac[j] = fac[j - 1] * j % MOD

inv[N] = pow(fac[N], MOD - 2, MOD)
for j in range(N - 1, -1, -1):  inv[j] = inv[j + 1] * (j + 1) % MOD
    
def cmb(n, r):
    if r > n or n < 0 or r < 0:  return 0
    return fac[n] * inv[n - r] * inv[r] % MOD

ans = 0
for i in range(K + 1):
    ans += M * cmb(N - 1, i) * pow(M - 1, N - 1 - i, MOD)
    ans %= MOD
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, N = list(map(int,input().split()))

def f(x):
    return math.floor(A * x / B) - A * math.floor(x / B)

if B - 1 <= N:
    ans = f(B - 1)
else:
    ans = f(N)
print(ans)

Fixed submission:
import math

A, B, N = list(map(int,input().split()))

def f(x):
    return math.floor(A * x / B) - A * math.floor(x / B)

if B - 1 <= N:
    ans = f(B - 1)
else:
    ans = f(N)
print(ans)

Buggy python submission (verdict: Runtime Error):
A, B, N = list(map(int,input().split()))
if B - 1 <= N:
    ans = f(B - 1)
else:
    ans = f(N)
print(ans)

Fixed submission:
import math

A, B, N = list(map(int,input().split()))

def f(x):
    return math.floor(A * x / B) - A * math.floor(x / B)

if B - 1 <= N:
    ans = f(B - 1)
else:
    ans = f(N)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
length = len(S)
count = 0
ans = 0

for i in range(length):
    res = 0
    for j in range(i, length):
        res = (res * 10 + int(S[j])) % 2019
        if res == 0:
            count += 1
            
print(count)

Fixed submission:
S = input()
mod = [0 for _ in range(len(S))]
mod[0] = int(S[-1])
for i in range(1, len(S)):
    mod[i] = (mod[i - 1] + pow(10, i, 2019) * int(S[-1 - i])) % 2019
ans = 0
res = [0 for _ in range(2019)]
for i in range(len(S)):
    ans += res[mod[i]]
    res[mod[i]] += 1
print(ans + res[0])
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b)

def gcd(l):
    ans = l[0]
    for i in l:  ans = gcd_(ans, i)
    return ans

ans = 0

for i in range(1, K + 1):
    for j in range(1, K + 1):
        for k in range(1, K + 1):
            ans += gcd([i, j, k])

print(int(ans))

Fixed submission:
K = int(input())

def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b)

def gcd(l):
    ans = l[0]
    for i in l:  ans = gcd_(ans, i)
    return ans

ans = 0

for i in range(1, K + 1):
    for j in range(1, K + 1):
        for k in range(1, K + 1):
            ans += gcd([i, j, k])

print(int(ans))
Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

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

def cmb(n, r):
    if n < r:  return 0
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

dic = {}
for i in range(N):
    if A[i] in dic:  dic[A[i]] += 1
    else:  dic[A[i]] = 1
        
sum_ = 0
for i in dic: sum += cmb(dic[i], 2)

for i in range(N):
    ans = sum_ - (dic[A[i]] - 1)
    print(ans)

Fixed submission:
from operator import mul
from functools import reduce

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

def cmb(n, r):
    if n < r:  return 0
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

dic = {}
ma = max(A)
for i in range(N):
    if A[i] in dic:
        dic[A[i]] += 1
    else:
        dic[A[i]] = 1
        
c = [0 for _ in range(ma + 1)]
for i in dic:
    c[i] = cmb(dic[i], 2)
sum_ = sum(c)

for i in range(N):
    ans = sum_ - c[A[i]] + cmb(dic[A[i]] - 1, 2)
    print(ans)
Buggy python submission (verdict: Runtime Error):
def cin():  return list(map(int,input().split()))

def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b)

def gcd(l):
    ans = 0
    for i in l:  ans = gcd_(ans, i)
    return ans

def lcm_(x,y):
    return (x * y) // gcd_(x, y)

def lcm(l):
    ans = l[0]
    for i in l:  ans = lcm_(ans, i)
    return ans

N = cin()[0]
v = cin()
lc = lcm(v)
ans = 0
INF = 10 ** 9 + 7
for i in range(N):
    ans += lc / v[i]
    ans %= INF
print(int(ans))

Fixed submission:
def cin():  return list(map(int,input().split()))

def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b)

def gcd(l):
    ans = 0
    for i in l:  ans = gcd_(ans, i)
    return ans

def lcm_(x,y):
    return (x * y) // gcd_(x, y)

def lcm(l):
    ans = l[0]
    for i in l:  ans = lcm_(ans, i)
    return ans

N = cin()[0]
v = cin()
lc = lcm(v)
ans = 0
INF = 10 ** 9 + 7
lc %= INF
for i in range(N):
    ans += lc * pow(v[i], INF - 2, INF)
    ans %= INF
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
deg = [0 for _ in range(N)]
edges = [[] for _ in range(N - 1)]
for i in range(N - 1):
    a, b = map(int, input().split())
    edges[i] = [a - 1, b - 1]
    deg[a - 1] += 1
    deg[b - 1] += 1
deg_max = max(deg)

def add(arg):  return 1 + arg % deg_max

ans = [0 for _ in range(N - 1)]
usd = [[0 for _ in range(deg_max + 3)] for _ in range(N)]
temp = 0
for i in range(N - 1):
    temp = add(temp)
    a = edges[i][0]
    b = edges[i][1]
    while(usd[a][temp] == 1 or usd[b][temp] == 1):  add(temp)
    ans[i] = temp
    usd[a][temp] = 1
    usd[b][temp] = 1
print(deg_max)
for i in range(N - 1):  print(ans[i])

Fixed submission:
N = int(input())
deg = [0 for _ in range(N)]
edges = [[] for _ in range(N - 1)]
a = []
for i in range(N - 1):
    in1, in2 = map(int, input().split())
    a.append([in1, in2, i])
a = sorted(a, key = lambda x: x[0])
for i in range(N - 1):
    edges[i] = [a[i][0] - 1, a[i][1] - 1, a[i][2]]
    deg[a[i][0] - 1] += 1
    deg[a[i][1] - 1] += 1
deg_max = max(deg)
print(deg_max)

co = [0 for _ in range(N)]
ans = [0 for _ in range(N - 1)]
for i in range(N - 1):
    a = edges[i][0]
    b = edges[i][1]
    temp = 1 + (co[a] % deg_max)
    co[a] = temp
    co[b] = temp
    ans[edges[i][2]] = temp
for i in range(N - 1):  print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
deg = [0 for _ in range(N)]
edges = [[] for _ in range(N - 1)]
for i in range(N - 1):
    a, b = map(int, input().split())
    edges[i] = [a - 1, b - 1]
    deg[a - 1] += 1
    deg[b - 1] += 1
deg_max = max(deg)

def add(arg):  return 1 + arg % deg_max

ans = [0 for _ in range(N - 1)]
usd = [[0 for _ in range(deg_max + 3)] for _ in range(N)]
temp = 0
for i in range(N - 1):
    temp = add(temp)
    a = edges[i][0]
    b = edges[i][1]
    while(usd[a][temp] == 0 and usd[b][temp] == 0):  add(temp)
    ans[i] = temp
    usd[a][temp] = 1
    usd[b][temp] = 1
print(deg_max)
for i in range(N - 1):  print(ans[i])

Fixed submission:
N = int(input())
deg = [0 for _ in range(N)]
edges = [[] for _ in range(N - 1)]
a = []
for i in range(N - 1):
    in1, in2 = map(int, input().split())
    a.append([in1, in2, i])
a = sorted(a, key = lambda x: x[0])
for i in range(N - 1):
    edges[i] = [a[i][0] - 1, a[i][1] - 1, a[i][2]]
    deg[a[i][0] - 1] += 1
    deg[a[i][1] - 1] += 1
deg_max = max(deg)
print(deg_max)

co = [0 for _ in range(N)]
ans = [0 for _ in range(N - 1)]
for i in range(N - 1):
    a = edges[i][0]
    b = edges[i][1]
    temp = 1 + (co[a] % deg_max)
    co[a] = temp
    co[b] = temp
    ans[edges[i][2]] = temp
for i in range(N - 1):  print(ans[i])
Buggy python submission (verdict: Runtime Error):
X, Y = list(map(int,input().split()))

from functools import reduce

def cmb(n, r, p):
    r = min(n - r, r)
    if r == 0:  return 1
    numer = reduce(lambda x, y: (x * y) % p, range(n, n - r, -1))
    denom = reduce(lambda x, y: (x * y) % p, range(1, r + 1))
    return (numer * pow(denom, p - 2, p)) % p

temp1 = 2 * X - Y
temp2 = 2 * Y - X
if temp1 % 3 or temp2 % 3:  print(0)
else:
    a = temp1 // 3
    b = temp2 // 3
    print(cmb(a + b, a, 10 ** 9 + 7))

Fixed submission:
X, Y = list(map(int,input().split()))

from functools import reduce

def cmb(n, r):
    INF = 10 ** 9 + 7
    r = min(n - r, r)
    if r == 0:  return 1
    numer = reduce(lambda x, y: (x * y) % INF, range(n, n - r, -1))
    denom = reduce(lambda x, y: (x * y) % INF, range(1, r + 1))
    return (numer * pow(denom, INF - 2, INF)) % INF

temp1 = 2 * X - Y
temp2 = 2 * Y - X
if temp1 % 3 or temp2 % 3:  print(0)
elif temp1 < 0 or temp2 < 0:  print(0)
else:
    a = temp1 // 3
    b = temp2 // 3
    print(cmb(a + b, a))

Buggy python submission (verdict: Runtime Error):
X, Y = list(map(int,input().split()))

from functools import reduce

def cmb(n, r, p):
    r = min(n - r, r)
    if r == 0:  return 1
    numer = reduce(lambda x, y: (x * y) % p, range(n, n - r, -1))
    denom = reduce(lambda x, y: (x * y) % p, range(1, r + 1))
    return (numer * pow(denom, p - 2, p)) % p

temp1 = 2 * X - Y
temp2 = 2 * X - Y
if temp1 % 3 or temp2 % 3:  print(0)
else:
    a = temp1 // 3
    b = temp2 // 3
    print(cmb(a + b, a, 10 ** 9 + 7))

Fixed submission:
X, Y = list(map(int,input().split()))

from functools import reduce

def cmb(n, r):
    INF = 10 ** 9 + 7
    r = min(n - r, r)
    if r == 0:  return 1
    numer = reduce(lambda x, y: (x * y) % INF, range(n, n - r, -1))
    denom = reduce(lambda x, y: (x * y) % INF, range(1, r + 1))
    return (numer * pow(denom, INF - 2, INF)) % INF

temp1 = 2 * X - Y
temp2 = 2 * Y - X
if temp1 % 3 or temp2 % 3:  print(0)
elif temp1 < 0 or temp2 < 0:  print(0)
else:
    a = temp1 // 3
    b = temp2 // 3
    print(cmb(a + b, a))
Buggy python submission (verdict: Runtime Error):
import math

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

a, b, x = cin()

if 2 * x <= a ** 2 * b:
    p = 2 * x / (a * b)
    print(math.degrees(math.atan(b / p)))
else:
    S = x / a
    p = 2 * (a * b - S) / a
    print(90 - math.degrees(math.atan(a / p)))

Fixed submission:
import math

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

a, b, x = cin()
if a * a * b == x:  print(0)
else:
    if 2 * x <= a ** 2 * b:
        p = 2 * x / (a * b)
        print(math.degrees(math.atan(b / p)))
    else:
        S = x / a
        p = 2 * (a * b - S) / a
        print(90 - math.degrees(math.atan(a / p)))

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

a, b, x = cin()

if 2 * x <= a ** 2 * b:
    p = 2 * x / (a * b)
    print(math.degrees(math.atan(b / p)))
else:
    S = x / a
    p = 2 * (a * b - S) / a
    print(90 - math.degrees(math.atan(a / p)))

Fixed submission:
import math

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

a, b, x = cin()
if a * a * b == x:  print(0)
else:
    if 2 * x <= a ** 2 * b:
        p = 2 * x / (a * b)
        print(math.degrees(math.atan(b / p)))
    else:
        S = x / a
        p = 2 * (a * b - S) / a
        print(90 - math.degrees(math.atan(a / p)))
Buggy python submission (verdict: Runtime Error):
A, B = cin()

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

def sieve(N):
    p = 0
    prime = []
    is_prime = [1 for _ in range(N + 1)]
    is_prime[0], is_prime[1] = 0, 0
    for i in range(2, N + 1):
        if is_prime[i]:
            p += 1
            temp = i
            prime.append(i)
            while(temp <= N):
                is_prime[temp] = 0
                temp += i
            is_prime[i] = 1
    return prime

s = sieve(int(min(A, B) ** 0.5) + 1)
s.append(1)
ans = 0
for i in s:
    if A % i == 0 and B % i == 0:
        ans += 1
print(ans)

Fixed submission:
import collections

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:  f += 2
    if n != 1:  a.append(n)
    return a

A, B = cin()
A, B = min(A, B), max(A, B)
res = collections.Counter(prime_factorize(A))
keys = list(res.keys())
keys.append(1)
ans = 0
for i in keys:
    if B % i == 0:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

def sieve(N):
    p = 0
    prime = []
    is_prime = [1 for _ in range(N + 1)]
    is_prime[0], is_prime[1] = 0, 0
    for i in range(2, N + 1):
        if is_prime[i]:
            p += 1
            temp = i
            prime.append(i)
            while(temp <= N):
                is_prime[temp] = 0
                temp += i
            is_prime[i] = 1
    return prime
  
A, B = cin()
s = sieve(min(A, B))
s.append(1)
ans = 0
for i in s:
    if A % i == 0 and B % i == 0:
        ans += 1
print(ans)

Fixed submission:
import collections

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:  f += 2
    if n != 1:  a.append(n)
    return a

A, B = cin()
A, B = min(A, B), max(A, B)
res = collections.Counter(prime_factorize(A))
keys = list(res.keys())
keys.append(1)
ans = 0
for i in keys:
    if B % i == 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import heapq

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

N, M = cin()
A = cin()
x = []
for i in range(N):
    heapq.heappush(x, -A[i])
for i in range(M):
    p = -heapq.heappop(x)
    heapq.heappush(x, -(p // 2))
ans = -sum(x)
print(ans)

Fixed submission:
import heapq
N, M = list(map(int,input().split()))
A = list(map(int,input().split()))
x = []
for i in range(N):
    heapq.heappush(x, -A[i])
for i in range(M):
    p = -heapq.heappop(x)
    heapq.heappush(x, -(p // 2))
ans = -sum(x)
print(ans)

Buggy python submission (verdict: Runtime Error):
import heapq
N, M = cin()
A = cin()
x = []
for i in range(N):
    heapq.heappush(x, -A[i])
for i in range(M):
    p = -heapq.heappop(x)
    heapq.heappush(x, -(p // 2))
ans = -sum(x)
print(ans)

Fixed submission:
import heapq
N, M = list(map(int,input().split()))
A = list(map(int,input().split()))
x = []
for i in range(N):
    heapq.heappush(x, -A[i])
for i in range(M):
    p = -heapq.heappop(x)
    heapq.heappush(x, -(p // 2))
ans = -sum(x)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = cin()[0]
S = input()

def alpha2num(alpha):
    num = 0
    for index, item in enumerate(list(alpha)):
        num += pow(26, len(alpha) - index - 1) * (ord(item) - ord('a') + 1)
    return num

def rol_hash(l):

    b, h = 10 ** 6 + 7, 10 ** 9 + 7
    base = pow(b, l, h)
    hash_s = 0
    dic = {}
    for i in range(l):  hash_s = (hash_s * b + alpha2num(S[i])) % h
    dic[hash_s] = l - 1
    for i in range(N - l + 1):
        if i + l < N:
            hash_s = (hash_s * b - base * alpha2num(S[i]) + alpha2num(S[i + l])) % h
            if hash_s in dic:
                if dic[hash_s] < i:  return 1
            else:  dic[hash_s] = i + l - 1
    return 0

def is_ok(mid):
    return rol_hash(mid)

def binary_search(left, right):
    while (abs(right - left) > 1):
        mid = (left + right) // 2
        if is_ok(mid):  right = mid
        else:  left = mid
    return right

left = N + 1
right = -1
ret = binary_search(left, right)
if ret == right:  print(0)
else:  print(ret)

Fixed submission:
def cin():  return list(map(int,input().split()))

def alpha2num(alpha):
    num = 0
    for index, item in enumerate(list(alpha)):  num += pow(26, len(alpha) - index - 1) * (ord(item) - ord('a') + 1)
    return num

def rol_hash(l):

    b, h = 1007, 10 ** 9 + 9
    base = pow(b, l, h)
    hash_s = 0
    dic = {}
    for i in range(l):  hash_s = (hash_s * b + alpha2num(S[i])) % h
    dic[hash_s] = l - 1
    for i in range(1, N - l + 1):
        hash_s = (hash_s * b - base * alpha2num(S[i - 1]) + alpha2num(S[i + l - 1])) % h
        if hash_s in dic:
            if S[dic[hash_s] - l + 1:dic[hash_s] + 1] == S[i:i + l] and dic[hash_s] < i:  return 1
        else:  dic[hash_s] = i + l - 1
    return 0

def is_ok(mid):  return rol_hash(mid)

def binary_search(left, right):
    while (abs(right - left) > 1):
        mid = (left + right) // 2
        if is_ok(mid):  right = mid
        else:  left = mid
    return right

N = cin()[0]
S = input()

left = N + 1
right = -1
ret = binary_search(left, right)
if ret == right:  print(0)
else:  print(ret)