Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
import bisect
import math

def gcd(a, b):
    return math.gcd(a, b)

def lcm(a, b):
    return a * b / gcd(a, b)

class slist(list):
    def __init__(self, *args, **kw):
        list.__init__(self, *args, **kw)
        self.sort()

    def append(self, value):
        bisect.insort(self,value)

    def index_left(self, value):
        return bisect.bisect_left(self, value)

def calc(n, a, b):
    return int(n/a) + int(n/b) - int(n/lcm(a,b))

if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    ans = calc(b, c, d) - calc(a - 1, c, d)
    print(b - a + 1 - ans)


Fixed submission:
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
import bisect
import fractions

def gcd(a, b):
    return fractions.gcd(a, b)

def lcm(a, b):
    return a * b // gcd(a, b)

def calc(n, a, b):
    return n//a + n//b - n//lcm(a,b)

if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    num1 = b - calc(b,c,d)
    num2 = (a-1) - calc(a-1, c,d)
    # ans = calc(b, c, d) - calc(a - 1, c, d)
    # print(b - a + 1 - ans)
    print(num1-num2)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
import bisect
import math

def gcd(a, b):
    return math.gcd(a, b)

def lcm(a, b):
    return a * b / gcd(a, b)

class slist(list):
    def __init__(self, *args, **kw):
        list.__init__(self, *args, **kw)
        self.sort()

    def append(self, value):
        bisect.insort(self,value)

    def index_left(self, value):
        return bisect.bisect_left(self, value)

def calc(n, a, b):
    return int(n/a) + int(n/b) - int(n/lcm(a,b))

if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    ans = calc(b, c, d) - calc(a - 1, c, d)
    print(b - a + 1 - ans)


Fixed submission:
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
import bisect
import fractions

def gcd(a, b):
    return fractions.gcd(a, b)

def lcm(a, b):
    return a * b // gcd(a, b)

def calc(n, a, b):
    return n//a + n//b - n//lcm(a,b)

if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    num1 = b - calc(b,c,d)
    num2 = (a-1) - calc(a-1, c,d)
    # ans = calc(b, c, d) - calc(a - 1, c, d)
    # print(b - a + 1 - ans)
    print(num1-num2)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
import bisect
import math
input = sys.stdin.readline

def gcd(a, b):
    return math.gcd(a, b)

def lcm(a, b):
    return a * b / gcd(a, b)

class slist(list):
    def __init__(self, *args, **kw):
        list.__init__(self, *args, **kw)
        self.sort()

    def append(self, value):
        bisect.insort(self,value)

    def index_left(self, value):
        return bisect.bisect_left(self, value)


if __name__ == '__main__':
    a,b = map(int, input().split())
    if a <= 8 and b <= 8:
        print('Yay!')
    else:
        print(':()')


Fixed submission:
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
import bisect
import math
import sys
input = sys.stdin.readline

def gcd(a, b):
    return math.gcd(a, b)

def lcm(a, b):
    return a * b / gcd(a, b)

class slist(list):
    def __init__(self, *args, **kw):
        list.__init__(self, *args, **kw)
        self.sort()

    def append(self, value):
        bisect.insort(self,value)

    def index_left(self, value):
        return bisect.bisect_left(self, value)


if __name__ == '__main__':
    a,b = map(int, input().split())
    if a <= 8 and b <= 8:
        print('Yay!')
    else:
        print(':(')
Buggy python submission (verdict: Runtime Error):
import re
import sys

if __name__ == '__main__':
    N = int(input())
    li = input().split()
    d = dict()
    for l in li:
        d[l] = 1
    print len(d)
        


Fixed submission:
import re
import sys

if __name__ == '__main__':
    N = int(input())
    li = raw_input().split()
    d = dict()
    for l in li:
        d[l] = 1
    if len(d) == 4:
        print 'Four'
    else:
        print 'Three'
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

if __name__ == '__main__':
    N = input()
    n0 = 2
    n1 = 1
    if N == 1:
        print(1)
    now = 1
    while now != N:
        n = n0 + n1
        n0 = n1
        n1 = n
        now += 1
    print(n)


Fixed submission:
# -*- coding: utf-8 -*-

if __name__ == '__main__':
    N = input()
    n0 = 2
    n1 = 1
    if N == 1:
        print(1)
    else:    
        now = 1
        while now != N:
            n = n0 + n1
            n0 = n1
            n1 = n
            now += 1
        print(n)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

def function(N):
    if N == 0:
        return(2)
    elif N == 1:
        return(1)
    else:
        return(function(N-1)+function(N-2))

if __name__ == '__main__':
    N = input()
    print(function(N))


Fixed submission:
# -*- coding: utf-8 -*-

if __name__ == '__main__':
    N = input()
    n0 = 2
    n1 = 1
    if N == 1:
        print(1)
    else:    
        now = 1
        while now != N:
            n = n0 + n1
            n0 = n1
            n1 = n
            now += 1
        print(n)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
H, W = map(int, raw_input().split())
c = [[0 for i in range(10)] for j in range(10)]
A = [[0 for i in range(W)] for j in range(H)]
for i in range(10):
    n = map(int, raw_input().split())
    for j in range(10):
        c[i][j] = n[j]
for i in range(H):
    n = map(int, raw_input().split())
    for j in range(W):
        A[i][j] = n[j]
def getDistance(start):
    if start == 1:
        return 0
    d = [1000 for i in range(10)]
    d[start] = 0
    prev = [-1 for i in range(10)]
    Q = set()
    for i in range(10):
        Q.add(i)
    while len(Q) != 0:
        min = 1000
        for i in range(10):
            if d[i] < min and i in Q:
                min = d[i]
                u = i
        Q.remove(u)
        for v in range(10):
            if d[v] > d[u] + c[u][v]:
                d[v] = d[u] + c[u][v]
                prev[v] = u
    return(d[1])



if __name__ == '__main__':
    D = [0 for i in range(10)]
    for i in range(10):
        D[i] = getDistance(i)
    ans = 0
    for i in range(H):
        for j in range(W):
            if A[i][j] != -1:
                ans += D[A[i][j]]
    print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
H, W = map(int, raw_input().split())
c = [[0 for i in range(10)] for j in range(10)]
A = [[0 for i in range(W)] for j in range(H)]
for i in range(10):
    n = map(int, raw_input().split())
    for j in range(10):
        c[i][j] = n[j]
for i in range(H):
    n = map(int, raw_input().split())
    for j in range(W):
        A[i][j] = n[j]
        
def getDistance(start):
    if start == 1:
        return 0
    d = [1001 for i in range(10)]
    d[start] = 0
    prev = [-1 for i in range(10)]
    Q = set()
    for i in range(10):
        Q.add(i)
    while len(Q) != 0:
        min = 1001
        for i in range(10):
            if d[i] < min and i in Q:
                min = d[i]
                u = i
        Q.remove(u)
        for v in range(10):
            if d[v] > d[u] + c[u][v]:
                d[v] = d[u] + c[u][v]
                prev[v] = u
    return(d[1])



if __name__ == '__main__':
    D = [0 for i in range(10)]
    for i in range(10):
        D[i] = getDistance(i)
    ans = 0
    for i in range(H):
        for j in range(W):
            if A[i][j] != -1:
                ans += D[A[i][j]]
    print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
if __name__ == '__main__':
    N = raw_input()
    A = map(int, raw_input().split())
    c_total = 1
    c_odd = 1
    for a in A:
        if a != 1 or a != 100:
            c_total *= 3
        else:
            c_total *= 2
        if a % 2 == 0 and a != 100:
            c_odd *= 2
    print c_total - c_odd


Fixed submission:
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
if __name__ == '__main__':
    S = raw_input()
    flg = True
    for index in range(len(S) - 1):
        if S[index]+S[index+1] == 'AC':
            print 'Yes'
            flg = False
            break
    if flg:
        print 'No'

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
if __name__ == '__main__':
    S = input()
    flg = True
    for index in range(len(S) - 1):
        if S[index]+S[index+1] == 'AC':
            print 'Yes'
            flg = False
            break
    if flg:
        print 'No'


Fixed submission:
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
if __name__ == '__main__':
    S = raw_input()
    flg = True
    for index in range(len(S) - 1):
        if S[index]+S[index+1] == 'AC':
            print 'Yes'
            flg = False
            break
    if flg:
        print 'No'

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
if __name__ == '__main__':
    S = input()
    if 'AC' in S:
        print 'Yes'
    else:
        print 'No'


Fixed submission:
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
if __name__ == '__main__':
    S = raw_input()
    flg = True
    for index in range(len(S) - 1):
        if S[index]+S[index+1] == 'AC':
            print 'Yes'
            flg = False
            break
    if flg:
        print 'No'
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
if __name__ == '__main__':
    N = raw_input()
    A = map(int, raw_input().split())
    c_total = 1
    c_odd = 1
    for a in A:
            c_total *= 3
        if a % 2 == 0 and a != 100:
            c_odd *= 2
    print c_total - c_odd


Fixed submission:
# -*- coding: utf-8 -*-
if __name__ == '__main__':
    N = raw_input()
    A = map(int, raw_input().split())
    c_total = 1
    c_odd = 1
    for a in A:
        c_total *= 3
        if a % 2 == 0:
            c_odd *= 2
    print c_total - c_odd
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A,B,C = map(int, raw_input().split())
if A == B:
    print(C):
if A == C:
    print(B)
if B == C:
    print(A)


Fixed submission:
# -*- coding: utf-8 -*-
A,B,C = map(int, raw_input().split())
if A == B:
    print(C)
if A == C:
    print(B)
if B == C:
    print(A)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    a = raw_input()
    b = raw_input()
    h = raw_input()
    print ((a + b) * h / 2)


Fixed submission:
if __name__ == '__main__':
    a = input()
    b = input()
    h = input()
    print ((a + b) * h / 2)
Buggy python submission (verdict: Runtime Error):
import numpy as np

ina = input()
N = int(ina)
x_list = []
y_list = []
dx_list = []
dy_list = []
for i in range(N):
  x,y,d = input().split()
  x_list.append(float(x))
  y_list.append(float(y))
  if d == 'L':
  	dx_list.append(-1)
  	dy_list.append(0)
  elif d == 'R':
  	dx_list.append(1)
  	dy_list.append(0)
  elif d == 'D':
  	dy_list.append(-1)
  	dx_list.append(0)
  elif d == 'U':
  	dy_list.append(1)
  	dx_list.append(0)


x = np.array(x_list)
y = np.array(y_list)
dx = np.array(dx_list)
dy = np.array(dy_list)

min_obj = (max(x)-min(x)) * (max(y)-min(y))

t = 0
t_min = 0
for t in range(1, 10000):
  x = x + dx*0.1
  y = y + dy*0.1
  obj = (max(x)-min(x)) * (max(y)-min(y))
  if obj < min_obj:
    min_obj = obj
    t_min = t
  if t_min + 500 < t:
    break
print(min_obj)

Fixed submission:
ina = input()
ina = ina.split()
X = ina[0]
A = ina[1]
if X<A:
  print("0")
else:
  print("10")

Buggy python submission (verdict: Runtime Error):
ina = input()
inb = input()
N, K = ina.split()
N = int(N)
K = int(K)

a = inb.split()
a = [int(elem) for elem in a]

total = 0
for i in range(len(a)):
  for j in range(i+1, len(a)+1):
    if sum(a[i:j]) >= K:
      total += 1 + len(a)-j
      break
print(total)

Fixed submission:
ina = input()
ina = ina.split()
X = ina[0]
A = ina[1]
if X<A:
  print("0")
else:
  print("10")
Buggy python submission (verdict: Time Limit Exceeded):

N, M = map(int, input().split(" "))
AL = list(map(int, [input() for _ in range(M)]))

# DP
dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 1 if 1 not in AL else 0
divisor = 10 ** 9 + 7

for i in range(2, N + 1):
    if i in AL:
        continue
    dp[i] = (dp[i-1] + dp[i-2]) % divisor
print(dp[N])

Fixed submission:
N, M = map(int, input().split(" "))
AL = list(map(int, [input() for _ in range(M)]))

# DP
dp = [1] * (N + 1)
for A in AL:
    dp[A] = 0

for i in range(2, N + 1):
    if dp[i] == 1:
        dp[i] = (dp[i-1] + dp[i-2]) % (10**9 + 7)
print(dp[N])

Buggy python submission (verdict: Runtime Error):
from itertools import permutations

N, M = map(int, input().split(" "))
AL = list(map(int, [input() for _ in range(M)]))

patterns = []
for i in range(N, -1, -2):
    pattern = [1] * i
    while sum(pattern) < N:
        pattern.append(2)
    else:
        patterns.extend(set(permutations(pattern)))
import ipdb; ipdb.set_trace()
ans = 0
for pattern in patterns:
    now = 0
    for p in pattern:
        if now + p not in AL:
            now += p
        else:
            break
    else:
        ans += 1
print(ans)


Fixed submission:
N, M = map(int, input().split(" "))
AL = list(map(int, [input() for _ in range(M)]))

# DP
dp = [1] * (N + 1)
for A in AL:
    dp[A] = 0

for i in range(2, N + 1):
    if dp[i] == 1:
        dp[i] = (dp[i-1] + dp[i-2]) % (10**9 + 7)
print(dp[N])
Buggy python submission (verdict: Runtime Error):
L = list(input())
mod = 10**9 + 7

dp = [[0]*2 for _ in range(len(L)+1)]

# 最初は1が確定なため
dp[1][0] = 1
dp[1][1] = 2

for i in range(1, len(L)):
    print(i)
    if L[i] == "0":
        dp[i+1][1] = dp[i][1]
        dp[i+1][0] = 3*dp[i][0]
    else:
        import ipdb; ipdb.set_trace()
        dp[i+1][1] = 2*dp[i][1]
        dp[i+1][0] = 3*dp[i][0] + dp[i][1]
    dp[i+1][0] %= mod
    dp[i+1][1] %= mod
print(sum(dp[len(L)]) % mod)


Fixed submission:
L = list(input())
mod = 10**9 + 7

dp = [[0]*2 for _ in range(len(L)+1)]

# 最初は1が確定なため
dp[1][0] = 1
dp[1][1] = 2

for i in range(1, len(L)):
    if L[i] == "0":
        dp[i+1][1] = dp[i][1]
        dp[i+1][0] = 3*dp[i][0]
    else:
        dp[i+1][1] = 2*dp[i][1]
        dp[i+1][0] = 3*dp[i][0] + dp[i][1]
    dp[i+1][0] %= mod
    dp[i+1][1] %= mod
print(sum(dp[len(L)]) % mod)
Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":

    date = input().replace("　", " ").split(" ")

    if date[0] <= date[1]:
        print(date[0])
    else:
        print(date[0]-1)


Fixed submission:
if __name__ == "__main__":

    date = input().replace("　", " ").split(" ")

    if date[0] <= date[1]:
        print(date[0])
    else:
        print(int(date[0])-1)

Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    date = input().split(" ")
    if date[0] <= date[1]:
        print(date[0])
    else:
        print(date[0]-1)

Fixed submission:
if __name__ == "__main__":

    date = input().replace("　", " ").split(" ")

    if date[0] <= date[1]:
        print(date[0])
    else:
        print(int(date[0])-1)
Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    abc = input().replace("　", " ").split(" ")
    import pdb;pdb.set_trace()
    abc = [int(x) for x in abc]
    abc.sort(reverse=True)
    k = int(input())
    print(abc[0] * (2**k) + abc[1] + abc[2])

Fixed submission:
if __name__ == "__main__":
    abc = input().replace("　", " ").split(" ")
    abc = [int(x) for x in abc]
    abc.sort(reverse=True)
    k = int(input())
    print(abc[0] * (2**k) + abc[1] + abc[2])

Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    abc = input().replace("　", " ").split(" ")
    abc = [int(x) for x in abc].sort(reverse=True)
    k = int(input())
    print(abc[0] * (2**k)

Fixed submission:
if __name__ == "__main__":
    abc = input().replace("　", " ").split(" ")
    abc = [int(x) for x in abc]
    abc.sort(reverse=True)
    k = int(input())
    print(abc[0] * (2**k) + abc[1] + abc[2])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

def main():
    N, M = LI()
    S = LI()
    T = LI()
    dp = [[1] * (M + 1)] + [[1] + [0] * M for _ in range(N)]
    for j in range(1, 1 + N):
        for i in range(1, 1 + M):
            if S[j - 1] == T[i - 1]:
                dp[j][i] = (dp[j][i - 1] + dp[j - 1][i]) % MOD
            else:
                dp[j][i] = (dp[j][i - 1] + dp[j - 1][i] - dp[j - 1][i - 1]) % MOD
    ans = dp[-1][-1]
    return ans

print(main())

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

def main():
    N, M = LI()
    S = LI()
    T = LI()
    dp = [[1] * (M + 1)] + [[1] + [0] * M for _ in range(N)]
    for j in range(1, 1 + N):
        for i in range(1, 1 + M):
            if S[j - 1] == T[i - 1]:
                dp[j][i] = (dp[j][i - 1] + dp[j - 1][i]) % MOD
            else:
                dp[j][i] = (dp[j][i - 1] + dp[j - 1][i] - dp[j - 1][i - 1]) % MOD
    ans = dp[-1][-1]
    return ans

print(main())
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from itertools import product
from collections import Counter

def main():
    N = II()
    XY = []
    for _ in range(N):
        XY.append(LI())
    cnt = Counter()
    for p0, p1 in product(XY, repeat=2):
        dx, dy = p1[0] - p0[0], p1[1] - p0[1]
        if dx != 0 or dy != 0:
            cnt[(dx, dy)] += 1
    ans = N - max(cnt.values())
    return ans

print(main())

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from itertools import product
from collections import Counter

def main():
    N = II()
    if N == 1:
        return 1
    XY = []
    for _ in range(N):
        XY.append(LI())
    cnt = Counter()
    for p0, p1 in product(XY, repeat=2):
        dx, dy = p1[0] - p0[0], p1[1] - p0[1]
        if dx != 0 or dy != 0:
            cnt[(dx, dy)] += 1
    ans = N - max(cnt.values())
    return ans

print(main())
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

# factorials
_nfact = 10 ** 5 + 10
facts = [0] * _nfact
ifacts = [0] * _nfact
facts[0] = 1
ifacts[0] = 1
for i in range(1, _nfact):
    facts[i] = (facts[i - 1] * i) % MOD
    ifacts[i] = INV(facts[i])

def binomial(m, n):
    return facts[m] * ifacts[n] * ifacts[m - n]

def main():
    N, A, B, C = LI()
    D = DIV(100, 100 - C)
    ans = 0
    for m in range(N, 2 * N):
        x = binomial(m - 1, N - 1) * DIV(
            POW(A, N) * POW(B, m - N) + POW(A, m - N) * POW(B, N),
            POW(A + B, m)) % MOD
        y = (m * D) % MOD
        ans += (x * y) % MOD
    return ans

print(main())

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

# factorials
_nfact = 2 * (10 ** 5) + 10
facts = [0] * _nfact
facts[0] = 1
for i in range(1, _nfact):
    facts[i] = (facts[i - 1] * i) % MOD

def binomial(m, n):
    return DIV(facts[m], facts[n] * facts[m - n])

def main():
    N, A, B, C = LI()
    D = DIV(100, 100 - C)
    ans = 0
    ap, bp, abp = [1], [1], [POW(A + B, N)]
    for _ in range(0, N + 1):
        ap.append(ap[-1] * A % MOD)
        bp.append(bp[-1] * B % MOD)
        abp.append(abp[-1] * (A + B) % MOD)
    for m in range(N, 2 * N):
        x = binomial(m - 1, N - 1) * DIV(
            ap[N] * bp[m - N] + ap[m - N] * bp[N],
            abp[m - N]) % MOD
        y = (m * D) % MOD
        ans = (ans + (x * y) % MOD) % MOD
    return ans

print(main())
Buggy python submission (verdict: Runtime Error):
print()
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)

Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. flush: whether to forcibly flush the stream.



Fixed submission:
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

def main():
    r, D, x = LI()
    for i in range(10):
        x = r * x - D
        print(x)
    return


main()