Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [list(map(str,input())) for i in range(H)]

#1.角の黒マス（２マスと接している）が白で囲まれている場合
if S[0][0] == '#' and S[0][1] == S[1][0] == '.':
    print('No')
elif S[0][H-1] == '#' and S[0][H-2] == S[1][H-1] == '.':
    print('No')
elif S[W-1][0] == '#' and S[W-2][0] == S[W-1][1] == '.':
    print('No')
elif S[W-1][H-1] == '#' and S[W-2][H] == S[W][H-2] == '.':
    print('No')
else:
    print('Yes')
    


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

#H x Wのマスを全て"."の行列で覆う （H+2 x W+2） 
S1 = [list(map(str,input())) for i in range(H)]
for i in range(H):
    S1[i].insert(0,'#')
    S1[i].append('#')
S = S = [['#'] * (W + 2)] + S1 + [['#'] * (W + 2)]

cnt = 0

for i in range(1,H):
    for j in range(1,W):
        if S[i][j] == '#':
            if S[i-1][j] == S[i][j-1] == S[i][j+1] == S[i+1][j] == '.':
                cnt += 1
if cnt == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [list(map(str,input())) for i in range(H)]

if S[0][0] == '#' and S[0][1] == S[1][0] == '.':
    print('No')
elif S[0][H-1] == '#' and S[0][H-2] == S[1][H-1] == '.':
    print('No')
elif S[W-1][0] == '#' and S[W-2][0] == S[W-1][1] == '.':
    print('No')
elif S[W-1][H-1] == '#' and S[W-2][H] == S[W][H-2] == '.':
    print('No')
else:
    print('Yes')

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

#H x Wのマスを全て"."の行列で覆う （H+2 x W+2） 
S1 = [list(map(str,input())) for i in range(H)]
for i in range(H):
    S1[i].insert(0,'#')
    S1[i].append('#')
S = S = [['#'] * (W + 2)] + S1 + [['#'] * (W + 2)]

cnt = 0

for i in range(1,H):
    for j in range(1,W):
        if S[i][j] == '#':
            if S[i-1][j] == S[i][j-1] == S[i][j+1] == S[i+1][j] == '.':
                cnt += 1
if cnt == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [list(map(str,input())) for i in range(H)]

#4隅が黒で両隣が白の場合、達成不可能
if S[0][0] == '#' and S[0][1] == S[1][0] == '.':
    print('No')
elif S[0][H-1] == '#' and S[0][H-2] == S[1][H-1] == '.':
    print('No')
elif S[W-1][0] == '#' and S[W-2][0] == S[W-1][1] == '.':
    print('No')
elif S[W-1][H-1] == '#' and S[W-2][H] == S[W][H-2] == '.':
    print('No')
else:
    print('Yes')

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

#H x Wのマスを全て"."の行列で覆う （H+2 x W+2） 
S1 = [list(map(str,input())) for i in range(H)]
for i in range(H):
    S1[i].insert(0,'#')
    S1[i].append('#')
S = S = [['#'] * (W + 2)] + S1 + [['#'] * (W + 2)]

cnt = 0

for i in range(1,H):
    for j in range(1,W):
        if S[i][j] == '#':
            if S[i-1][j] == S[i][j-1] == S[i][j+1] == S[i+1][j] == '.':
                cnt += 1
if cnt == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
from operator import itemgetter

N = int(input())
Red = [list(map(int,input().split())) for _ in range(N)] #赤
Blue = [list(map(int,input().split())) for _ in range(N)] #青

Red1 = sorted(A, key=itemgetter(1),reverse = True)
Blue1 = sorted(B, key=itemgetter(0)) #ここが違った
cnt = 0

for i in range(N): 
    for j in range(N):
        if (Blue1[i][0] > Red1[j][0]) and (Blue1[i][1] > Red1[j][1]):
            cnt+=1
            Red1[j] = [500,500] #これがなかった
            #print(B1[i],A1[j])
            break #これがなかった
print(cnt)

Fixed submission:
from operator import itemgetter

N = int(input())
Red = [list(map(int,input().split())) for _ in range(N)] #赤
Blue = [list(map(int,input().split())) for _ in range(N)] #青

Red1 = sorted(Red, key=itemgetter(1),reverse = True)
Blue1 = sorted(Blue, key=itemgetter(0)) #ここが違った
cnt = 0

for i in range(N): 
    for j in range(N):
        if (Blue1[i][0] > Red1[j][0]) and (Blue1[i][1] > Red1[j][1]):
            cnt+=1
            Red1[j] = [500,500] #これがなかった
            #print(B1[i],A1[j])
            break #これがなかった
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n,y = map(int,input().split())

ans = 0
for i in range(2000):
    if ans != 0:
        break
    else:
        for j in range(2000-i):
            for k in range(2000-(i + j)):
                if (i + k + j)== n and (10000*i + 5000*j + 1000*k) == y:
                    print(i,j,k)
                    ans +=1
                else:
                    continue
                
if ans == 0:
    print('-1','-1','-1')

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

ans = 0
for i in range(2001):
    if ans != 0:
        break
    else:
        for j in range(2001-i):
            if (10000*i + 5000*j + 1000*(n-(i + j))) == y and ((n-(i + j)) >=0):       
                print(i,j,n-(i + j))
                ans +=1
            else:
                continue
                
if ans == 0:
    print('-1','-1','-1')

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

ans = 0
for i in range(1000):
    if ans != 0:
        break
    else:
        for j in range(1000):
            for k in range(1000):
                if (i + k + j)== n and (10000*i + 5000*j + 1000*k) == y:
                    print(i,j,k)
                    ans +=1
                else:
                    continue
                
if ans == 0:
    print('-1','-1','-1')

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

ans = 0
for i in range(2001):
    if ans != 0:
        break
    else:
        for j in range(2001-i):
            if (10000*i + 5000*j + 1000*(n-(i + j))) == y and ((n-(i + j)) >=0):       
                print(i,j,n-(i + j))
                ans +=1
            else:
                continue
                
if ans == 0:
    print('-1','-1','-1')

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

ans = 0
for i in range(1000):
    if ans != 0:
        break
    else:
        for j in range(1000):
            for k in range(1000):
                if (i + k + j)== n and (10000*i + 5000*j + 1000*k) == y:
                    print(i,j,k)
                    ans +=1
                else:
                    continue
                
if ans == 0:
    print('-1','-1','-1')

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

ans = 0
for i in range(2001):
    if ans != 0:
        break
    else:
        for j in range(2001-i):
            if (10000*i + 5000*j + 1000*(n-(i + j))) == y and ((n-(i + j)) >=0):       
                print(i,j,n-(i + j))
                ans +=1
            else:
                continue
                
if ans == 0:
    print('-1','-1','-1')
Buggy python submission (verdict: Time Limit Exceeded):
N, K  = map(int, input().split())
A = list(map(int , input().split()))

B = []
for i in range(1,N+1):
    S = A.count(i)
    B.append((i,int(S)))
B = sorted(B ,key = lambda x : x[1] ,reverse = True)
#print(B)

ans = 0
for i in range(K,N-K):
    ans += B[i][1]
print(ans)

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

from collections import Counter
from operator import itemgetter


ac = Counter(a)
aci = list(ac.items())
aci = sorted(aci,key=itemgetter(1),reverse = False)  
#print(aci)

ans = aci[:-k]
cnt=0
for i in range(len(ans)):
    cnt += ans[i][1]
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input()) 
f = [list(map(int, input().split())) for i in range(n)] 
p = [list(map(int, input().split())) for j in range(n)] 

ans = -9999999999

for i in range(1, 1024): 
    bf = 0  
    for j in range(n):  
        cnt = 0 
        for k in range(10): 
            if (i >> k) & 1 == 1 and f[j][k] == 1: 
                cnt += 1 
        bf += p[j][cnt] 
    ans =max(ans, bf)  　
    
print(ans)

Fixed submission:
n = int(input())
arr = [list(map(int, input().split())) for i in range(n)]
arm = [list(map(int, input().split())) for j in range(n)]  # 入力

ans = -9999999999  # 最小
for item in range(1, 1024):  # 2 ** 10 == 1024
    fund = 0
    for i in range(n):  # 店の数
        cou = 0  # かぶる数
        for x in range(10):  # 月-金(5) * 2
            if (item >> x) % 2 == 1 and arr[i][x] == 1:  # その時間で被るかどうか
                cou += 1
        fund += arm[i][cou]
    ans = max(ans, fund)  # 最大値更新

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))

from bisect import bisect_left, bisect

ans = 0
for i in range(N):
    b = B[i]
    a = bisect_left(A,b)
    c = bisect(C,b)
    #print(b,A[:a],C[c:])
    ans += len(A[:a])*len(C[c:])
print(ans)

Fixed submission:
from bisect import bisect_left, bisect

n=int(input())
la=sorted(list(map(int,input().split())))
lb=list(map(int,input().split()))
lc=sorted(list(map(int,input().split())))
ans=0
for i in lb:
    ans+=bisect_left(la,i)*(len(lc)-bisect(lc,i)) #iの挿入点つまりiより小さい値の数×(Cの総数-
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_left, bisect

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A = sorted(A,reverse = False)
C = sorted(C,reverse = False)

cnt = 0
for i in B:
    #print( A[:bisect_left(A,i)],C[bisect(C,i):])
    cnt += len(A[:bisect_left(A,i)]) *len(C[bisect(C,i):])
    
print(cnt)  

Fixed submission:
from bisect import bisect_left, bisect

n=int(input())
la=sorted(list(map(int,input().split())))
lb=list(map(int,input().split()))
lc=sorted(list(map(int,input().split())))
ans=0
for i in lb:
    ans+=bisect_left(la,i)*(len(lc)-bisect(lc,i)) #iの挿入点つまりiより小さい値の数×(Cの総数-
print(ans)

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

cnt = 0
for i in range(N): #中段について 
        for j in range(N): #上段について
            for k in range(N): #下段について 
                if A[j] < B[i] < C[k]:
                    cnt += 1
print(cnt)

Fixed submission:
from bisect import bisect_left, bisect

n=int(input())
la=sorted(list(map(int,input().split())))
lb=list(map(int,input().split()))
lc=sorted(list(map(int,input().split())))
ans=0
for i in lb:
    ans+=bisect_left(la,i)*(len(lc)-bisect(lc,i)) #iの挿入点つまりiより小さい値の数×(Cの総数-
print(ans)

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

cnt = 0
for i in range(N):
    for j in range(N):
        for k in range(N):
            if A[i] <B[j]:
                if B[j] < C[k]:
                    cnt += 1
print(cnt)

Fixed submission:
from bisect import bisect_left, bisect

n=int(input())
la=sorted(list(map(int,input().split())))
lb=list(map(int,input().split()))
lc=sorted(list(map(int,input().split())))
ans=0
for i in lb:
    ans+=bisect_left(la,i)*(len(lc)-bisect(lc,i)) #iの挿入点つまりiより小さい値の数×(Cの総数-
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = [int(input()) for i in range(n)]


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(t))

Fixed submission:
#import math  
import fractions
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Buggy python submission (verdict: Runtime Error):
#import math  
import fractions
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // functools.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Fixed submission:
#import math  
import fractions
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // functools.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Fixed submission:
#import math  
import fractions
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Fixed submission:
#import math  
import fractions
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)
Buggy python submission (verdict: Runtime Error):
import Data.Char (chr)

solve :: Int -> Int -> (Int, String)
solve p n = (q, chr (97 + r) : s)
  where
    (m, s) = if n > p
               then solve (p * 26) (n - p)
               else (n - 1, "")
    (q, r) = m `divMod` 26

main :: IO ()
main = getLine >>= putStrLn . snd . solve 26 . read


Fixed submission:
n = int(input())
p = 26
while n > p:
  n -= p
  p *= 26

n -= 1
s = ''
while p > 1:
  n, r = divmod(n, 26)
  s = chr(97 + r) + s
  p //= 26
print(s)
Buggy python submission (verdict: Runtime Error):
from math import comb

M = 10**9 + 7
n,a,b = map(int, input().split())

print(pow(2, n, M) - comb(n, a) % M - comb(n, b) % M)


Fixed submission:
M = 10**9 + 7
n,a,b = map(int, input().split())

def modinv(n):
    return pow(n, M-2, M)

def comb(n, r):
    num = 1
    for i in range(n,n-r,-1):
        cur = i
        while cur%M == 0:
            cur //= M
        num = (num*cur)%M

    denom = 1
    for i in range(1,r+1):
        cur = i
        while cur%M == 0:
            cur //= M
        denom = (denom*cur)%M

    return num * modinv(denom) % M


print((pow(2, n, M) - comb(n, a) - comb(n, b) - 1) % M)
Buggy python submission (verdict: Time Limit Exceeded):
import math

a, b, c, k = list(map(int, input().split()))

for i in range(k):
  m = b + c
  n = a + c
  o = a + b
  a = m
  b = n
  c = o

if math.fabs(a - b) > 1.0e18:
  print("Unfair")
else:
  print(int(a - b))


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

diff = (a - b) * ((-1) ** k)

if diff > 1.0e18:
  print("Unfair")
else:
  print(diff)
Buggy python submission (verdict: Runtime Error):
import math

a, b, c, d = list(map(int, input()))

if math.fabs(a - c) <= d:
  print("Yes")
elif math.fabs(a - b) <= d and math.fabs(b - c) <= d:
  print("Yes")
else:
  print("No")


Fixed submission:
import math

a, b, c, d = list(map(int, input().split()))

if math.fabs(a - c) <= d:
  print("Yes")
elif math.fabs(a - b) <= d and math.fabs(b - c) <= d:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
date = input()
date = list(date)
date[3] = '8'
date = ''.join(date)
print(date)


Fixed submission:
hour = int(input())

print(48 - hour)
Buggy python submission (verdict: Runtime Error):
import sys

#integer = list(map(int, str(input())))
integer = list(map(int, str(sys.argv[1])))

print(integer)
for i in range(10):
  if integer.count(i) >= 3:
    print("Yes")
    sys.exit()

print("No")


Fixed submission:
import sys

integer = list(map(int, str(input())))

for i in range(10):
  if integer[0:3] == [i, i, i] or integer[1:4] == [i, i, i] or integer[0:4] == [i, i, i, i]:
    print("Yes")
    sys.exit()

print("No")
Buggy python submission (verdict: Runtime Error):
x, y = list(input().split(" "))
if int(x, 16) > int(y, 16):
    print(">")
elif hex(x, 16) < hex(y, 16):
    print("<")
else:
    print("=")


Fixed submission:
x, y = list(input().split())

if x > y:
  print(">")
elif x == y:
  print("=")
else:
  print("<")
Buggy python submission (verdict: Runtime Error):
strlist1 = input()
strlist2 = input()

flag = True

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = false

if flag:
  print("YES")
else:
  print("NO")


Fixed submission:
strlist1 = input()
strlist2 = input()

flag = True

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = False

if flag:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
strlist1 = input()
strlist2 = input()
print(strlist1)
print(strlist2)

flag = true

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = false

if flag:
  print("YES")
else:
  print("NO")


Fixed submission:
strlist1 = input()
strlist2 = input()

flag = True

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = False

if flag:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
ans = 0
for i in range(len(b)):
    al = 0
    ar = n-1
    while True:
        if a[-1] < b[i]:
            an = n
            break
        if a[0] >= b[i]:
            an = 0
            break
        am = (al+ar)//2
        if a[am] < b[i]:
            al = am
        else:
            ar = am
        an = al + 1
        if al+1 == ar:
            break
    cl = 0
    cr = n-1
    while True:
        if c[0] > b[i]:
            cn = n
            break
        if c[-1] <= b[i]:
            cn = 0
            break
        cm = (cl+cr)//2
        if c[cm] <= b[i]:
            cl = cm
        else:
            cr = cm
        cn = n - cr
        if cl+1 == cr:
            break
    ans += an*cn
print(ans)

Fixed submission:
N = int(input())

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

A = sorted(A)
B = sorted(B)
C = sorted(C)

A.insert(0, -100000000000)
A.append(1000000000000)
C.insert(0, -100000000000)
C.append(1000000000000)


total= 0
for b in B:
    # search A
    l = 0
    r = N + 1
    while r - l > 1:
        m = (l + r) // 2
        if A[m] < b:
            l = m
        else:
            r = m

    a_count = l

    # search C
    l = 0
    r = N + 1
    while r - l > 1:
        m = (l + r) // 2
        if C[m] > b:
            r = m
        else:
            l = m

    c_count = N + 1 - r

    total += a_count * c_count

print(total)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
  return 0;
}


Fixed submission:
r = int(input())
g = int(input())

print(2 * g - r)

Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = 0; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
  return 0;
}


Fixed submission:
r = int(input())
g = int(input())

print(2 * g - r)

Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = 0; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
  return 0;
}


Fixed submission:
r = int(input())
g = int(input())

print(2 * g - r)
Buggy python submission (verdict: Runtime Error):
x, a, b = list(map(int, input().split()))

if math.fabs(x - a) > math.fabs(x - b):
  print("B")
else:
  print("A")


Fixed submission:
import math

x, a, b = list(map(int, input().split()))

if math.fabs(x - a) > math.fabs(x - b):
  print("B")
else:
  print("A")
Buggy python submission (verdict: Runtime Error):
n = int(input())
list_a = list(map(int, input().split(" ")))

min_diff = 10**9
for i in range(len(list_a)-1):
    sunuke = sum(list_a[:i+1])
    arai = sum(list_a[i+1:])
    diff = abs(sunuke - arai)
    if min_diff > diff:
        min_diff = diff

print(min_diff)


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

if (a + b) % 3 == 0 or a % 3 == 0 or b % 3 == 0:
  print("Possible")
else:
  print("Impossible")
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (b - a == c - b) {
    cout << "YES" << endl;
    return 0;
  } else {
    cout << "NO" << endl;
    return 0;
  }
}


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

if b - a == c - b:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
odd, even = input(), input()

for i in range(len(odd)):
  print(odd[i] + even[i], end="")

print("")


Fixed submission:
odd, even = input(), input()

for i in range(len(even)):
  print(odd[i] + even[i], end="")

if len(odd) == len(even) + 1:
  print(odd[len(odd) - 1])

print("")
Buggy python submission (verdict: Runtime Error):
n = int(input())
power = [1]

if n == 1:
    print(1)
    exit()

for i in range(2, n+1):
    power.append((i * power[-1]) % (10 ** 9 + 7))

print(power[-1])


Fixed submission:
s, c = list(map(int, input().split(" ")))

count = 0

if c >= 2 * s:
    print(s + ((c - s * 2) // 4))

else:
    count = (c - 1) // 2 if c % 2 == 1 else c // 2
    print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
power = [1]

if n == 1:
    print(1)
    exit()

for i in range(2, n+1):
    power.append((i * power[-1]) % (10 ** 9 + 7))

print(power[-1])


Fixed submission:
s, c = list(map(int, input().split(" ")))

count = 0

if c >= 2 * s:
    print(s + ((c - s * 2) // 4))

else:
    count = (c - 1) // 2 if c % 2 == 1 else c // 2
    print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
power = [1]

if n == 1:
    print(1)
    exit()

for i in range(2, n+1):
    power.append((i * power[-1]) % (10 ** 9 + 7))

print(power[-1])


Fixed submission:
s, c = list(map(int, input().split(" ")))

count = 0

if c >= 2 * s:
    print(s + ((c - s * 2) // 4))

else:
    count = (c - 1) // 2 if c % 2 == 1 else c // 2
    print(count)

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

count = 0
while True:
    if n > 0 and m > 1:
        count += 1
        n -= 1
        m -= 2
    elif n == 0 and m > 3:
        count += 1
        m -= 4
    elif n == 0 and m <= 3:
        print(count)
        exit()


Fixed submission:
s, c = list(map(int, input().split(" ")))

count = 0

if c >= 2 * s:
    print(s + ((c - s * 2) // 4))

else:
    count = (c - 1) // 2 if c % 2 == 1 else c // 2
    print(count)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = list(map(int, input().split()))

count = 0

for i in range(k + 1):
  for j in range(k + 1):
    for l in range(k + 1):
      if i + j + l > s:
        break

      if i + j + l == s:
        count+= 1

print(count)


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

count = 0

for i in range(k + 1):
  for j in range(k + 1):
    if i + j > s:
      break

    if s - (i + j) > k:
      continue

    count+=1

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

count = 0
for i in range(a, b + 1):
  if i % x == 0:
    count += 1

print(count)


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

count = b // x - (a - 1) // x
print(count)