Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
X = 3.14159265*2*R
print(X)

Fixed submission:
R=int(input())
X=3.14159265*2*R
print(X)

Buggy python submission (verdict: Runtime Error):
X = 3.12159265*2*R
print(X)

Fixed submission:
R=int(input())
X=3.14159265*2*R
print(X)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
List = list(input())
ListR = []
ListG = []
ListB = []

for i in range(N):
  if List[i]=="R":
    ListR.append(i)
  elif List[i]=="G":
    ListG.append(i)
  else:
    ListB.append(i)
    
ans = len(ListR)*len(ListG)*len(ListB)
for a in ListR:
  for i in range(1,max([a//2, 2000-a//2, min([a,4000-a])])):
    if a+i in ListG:
      if a+2*i in ListB:
        ans -=1
      if a-i in ListB:
        ans -=1
    if a-i in ListG:
      if a-2*i in ListB:
        ans -=1
      if a+i in ListB:
        ans -=1
    if a+2*i in ListG:
      if a+i in ListB:
        ans -=1
    if a-2*i in ListG:
      if a-i in ListB:
        ans -=1
print(ans)

Fixed submission:
N = int(input())
List = list(input())
ans = (List.count("R"))*(List.count("G"))*(List.count("B"))

for i in range(1,2000):
  for j in range(N-i*2):
    if {List[j], List[j+i], List[j+2*i]} == {"R","G","B"}:
      ans -=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
List = list(input())
ListR = []
ListG = []
ListB = []

for i in range(N):
  if List[i]=="R":
    ListR.append(i)
  elif List[i]=="G":
    ListG.append(i)
  else:
    ListB.append(i)
    
ans = len(ListR)*len(ListG)*len(ListB)
for a in ListR:
  for i in range(1,2000):
    if a+i in ListG:
      if a+2*i in ListB:
        ans -=1
      if a-i in ListB:
        ans -=1
    if a-i in ListG:
      if a-2*i in ListB:
        ans -=1
      if a+i in ListB:
        ans -=1
    if a+2*i in ListG:
      if a+i in ListB:
        ans -=1
    if a-2*i in ListG:
      if a-i in ListB:
        ans -=1
print(ans)



Fixed submission:
N = int(input())
List = list(input())
ans = (List.count("R"))*(List.count("G"))*(List.count("B"))

for i in range(1,2000):
  for j in range(N-i*2):
    if {List[j], List[j+i], List[j+2*i]} == {"R","G","B"}:
      ans -=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
List = list(input())
ListR = []
ListG = []
ListB = []

for i in range(N):
  if List[i]=="R":
    ListR.append(i)
  elif List[i]=="G":
    ListG.append(i)
  else:
    ListB.append(i)
    
ans = len(ListR)*len(ListG)*len(ListB)
for a in ListR:
  for b in ListG:
    for c in ListB:
      L=[a,b,c]
      L.sort()
      if L[1]-L[0] == L[2]-L[1]:
        ans -=1
print(ans)

Fixed submission:
N = int(input())
List = list(input())
ans = (List.count("R"))*(List.count("G"))*(List.count("B"))

for i in range(1,2000):
  for j in range(N-i*2):
    if {List[j], List[j+i], List[j+2*i]} == {"R","G","B"}:
      ans -=1
print(ans)
Buggy python submission (verdict: Runtime Error):
Str=list(input())
if Str[3]==Str[4] and Str[5]==Str[6]:
  print("Yes")
else:print("No")  

Fixed submission:
List=list(input())
if List[2]==List[3] and List[4]==List[5]:
  print("Yes")
else:print("No")
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
ls_a=sorted(list(map(int,input().split())))
ls_b=sorted(list(map(int,input().split())))
ls_c=sorted(list(map(int,input().split())))
ls_x=ls_a[A-X:A]
ls_y=ls_b[B-Y:B]
ls_c.reverse()

ans=sum(ls_x)+sum(ls_y)
a=b=c=0
for _ in range(X+Y):
  if a==len(ls_x):
    m=min([ls_y[b],ls_c[c]])
    if m==ls_y[b]:
      ans+=(-ls_y[b]+ls_c[c])
      b+=1
      c+=1
    else:
      break
  elif b==len(ls_y):
    m=min([ls_x[a],ls_c[c]])
    if m==ls_x[a]:
      ans+=(-ls_x[a]+ls_c[c])
      a+=1
      c+=1
    else:
      break
  else:    
    m=min([ls_x[a],ls_y[b],ls_c[c]])
    if m==ls_x[a]:
      ans+=(-ls_x[a]+ls_c[c])
      a+=1
      c+=1
    elif m==ls_y[b]:
      ans+=(-ls_y[b]+ls_c[c])
      b+=1
      c+=1
    else:
      break
print(ans)

Fixed submission:
X,Y,A,B,C=map(int,input().split())
ls_a=sorted(list(map(int,input().split())))
ls_b=sorted(list(map(int,input().split())))
ls_c=sorted(list(map(int,input().split())))
ls_x=ls_a[A-X:A]
ls_y=ls_b[B-Y:B]
ls_c.reverse()

ans=sum(ls_x)+sum(ls_y)
a=b=c=0
for _ in range(min([X+Y,C])):
  if a==len(ls_x):
    m=min([ls_y[b],ls_c[c]])
    if m==ls_y[b]:
      ans+=(-ls_y[b]+ls_c[c])
      b+=1
      c+=1
    else:
      break
  elif b==len(ls_y):
    m=min([ls_x[a],ls_c[c]])
    if m==ls_x[a]:
      ans+=(-ls_x[a]+ls_c[c])
      a+=1
      c+=1
    else:
      break
  else:    
    m=min([ls_x[a],ls_y[b],ls_c[c]])
    if m==ls_x[a]:
      ans+=(-ls_x[a]+ls_c[c])
      a+=1
      c+=1
    elif m==ls_y[b]:
      ans+=(-ls_y[b]+ls_c[c])
      b+=1
      c+=1
    else:
      break
print(ans)

Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
ls_a=sorted(list(map(int,input().split())))
ls_b=sorted(list(map(int,input().split())))
ls_c=sorted(list(map(int,input().split())))
ls_x=ls_a[A-X:A]
ls_y=ls_b[B-Y:B]
ls_c.reverse()

ans=sum(ls_x)+sum(ls_y)
a=b=c=0
for i in range(C):
  m=min([ls_x[a],ls_y[b],ls_c[c]])
  if m==ls_x[a]:
    ans+=(-ls_x[a]+ls_c[c])
    a+=1
    c+=1
  elif m==ls_y[b]:
    ans+=(-ls_y[b]+ls_c[c])
    b+=1
    c+=1
  else:
    break
print(ans)

Fixed submission:
X,Y,A,B,C=map(int,input().split())
ls_a=sorted(list(map(int,input().split())))
ls_b=sorted(list(map(int,input().split())))
ls_c=sorted(list(map(int,input().split())))
ls_x=ls_a[A-X:A]
ls_y=ls_b[B-Y:B]
ls_c.reverse()

ans=sum(ls_x)+sum(ls_y)
a=b=c=0
for _ in range(min([X+Y,C])):
  if a==len(ls_x):
    m=min([ls_y[b],ls_c[c]])
    if m==ls_y[b]:
      ans+=(-ls_y[b]+ls_c[c])
      b+=1
      c+=1
    else:
      break
  elif b==len(ls_y):
    m=min([ls_x[a],ls_c[c]])
    if m==ls_x[a]:
      ans+=(-ls_x[a]+ls_c[c])
      a+=1
      c+=1
    else:
      break
  else:    
    m=min([ls_x[a],ls_y[b],ls_c[c]])
    if m==ls_x[a]:
      ans+=(-ls_x[a]+ls_c[c])
      a+=1
      c+=1
    elif m==ls_y[b]:
      ans+=(-ls_y[b]+ls_c[c])
      b+=1
      c+=1
    else:
      break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
List=list(map(int,input().split()))
cnt=[0 for i in range(max(List)+1)]
for x in List:
  cnt[x]+=1
  
for i in range(1,N+1):
  cnt[List[i-1]]-=1
  print(sum([cnt[j]*(cnt[j]-1)//2 for j in range(len(cnt))])) 
  cnt[List[i-1]]+=1

Fixed submission:
n=int(input())
inp=list(map(int,input().split()))
hoge=[0 for i in range(n)]
huga=[0 for i in range(n)]
for i in inp:
  huga[i-1]+=1
  hoge[i-1]=(huga[i-1]-1)*huga[i-1]
some=sum(hoge)//2
for i in inp:
  if(huga[i-1]==2):
    print(some-1)
  else:
    print(some-int(huga[i-1]-1))
Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
Q=int(input())
ls=[list(input().split()) for _ in range(Q)]
a=1
for i in range(Q):
  if ls[i][0]=="1":
    a*=(-1)
  else:
    if (ls[i][1]=="1" and a==1) or (ls[i][1]=="2" and a==-1):
      S.insert(0,ls[i][2])
    else:
      S.append(ls[i][2])
print("".join(S) if a==1 else "".join(reversed(S)))

Fixed submission:
from collections import deque
S=list(input())
Q=int(input())
ls=[list(input().split()) for _ in range(Q)]
D=deque()
for i in range(len(S)):
  D.append(S[i])  
a=1
for i in range(Q):
  if ls[i][0]=="1":
    a*=(-1)
  else:
    if (ls[i][1]=="1" and a==1) or (ls[i][1]=="2" and a==-1):
      D.appendleft(ls[i][2])
    else:
      D.append(ls[i][2])
if a==1:
  while D:
    print(D.popleft(), end="")
else:    
  while D:
    print(D.pop(), end="")

Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
Q=int(input())
ls=[list(input().split()) for _ in range(Q)]
for i in range(Q):
  if ls[i][0]=="1":
    S.reverse()
  else:
    if ls[i][1]=="1":
      S.insert(0,ls[i][2])
    else:
      S.append(ls[i][2])
print("".join(S))

Fixed submission:
from collections import deque
S=list(input())
Q=int(input())
ls=[list(input().split()) for _ in range(Q)]
D=deque()
for i in range(len(S)):
  D.append(S[i])  
a=1
for i in range(Q):
  if ls[i][0]=="1":
    a*=(-1)
  else:
    if (ls[i][1]=="1" and a==1) or (ls[i][1]=="2" and a==-1):
      D.appendleft(ls[i][2])
    else:
      D.append(ls[i][2])
if a==1:
  while D:
    print(D.popleft(), end="")
else:    
  while D:
    print(D.pop(), end="")
Buggy python submission (verdict: Runtime Error):
N = int(input())
List = [input() for i in range(N)]
from collections import Counter
C = Counter(List)
C = C.most_common()
Newlist = []

for p in range(N):
  if C[p][1] == C[0][1]:
    Newlist.append(C[p][0])
  else:
    break
Newlist.sort()
for i in range(len(Newlist)):
  print(Newlist[i])

Fixed submission:
N = int(input())
List = [input() for i in range(N)]
from collections import Counter
C = Counter(List)
C = C.most_common()
Newlist = []

for p in range(len(C)):
  if C[p][1] == C[0][1]:
    Newlist.append(C[p][0])
  else:
    break
Newlist.sort()
for i in range(len(Newlist)):
  print(Newlist[i])
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
ls=list(map(int,input().split()))
ls_p=[(ls[i]+1)/2 for i in range(N)]
a=0
for i in range(K):
  a+=ls_p[i]
for i in range(N-K):
  c=a+ls_p[i+K]-ls_p[i]
  b=max([a,c])
  a=c
print(b)

Fixed submission:
N,K=map(int,input().split())
ls=list(map(int,input().split()))
ls_p=[(ls[i]+1)/2 for i in range(N)]
a=0
for i in range(K):
  a+=ls_p[i]
b=a  
for i in range(N-K):
  c=a+ls_p[i+K]-ls_p[i]
  b=max([b,c])
  a=c
print(b)
Buggy python submission (verdict: Runtime Error):
H, N = map(int,input().split())
ls = [list(map(int,input().split())) for _ in range(N)]

dp = [0]*(H+1)
for i in range(1, H+1):
  for j in range(N):
    if j == 0:
      dp[i] = dp[i-ls[j][0]] + ls[j][1]
    else:
      if ls[j][0] <= i:
        dp[i] = min([dp[i], dp[i-ls[j][0]] + ls[j][1]])
      else:
        dp[i] = min([dp[i], ls[j][1]])
        
print(dp[H])    

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

dp = [0]*(H+1)
for i in range(1, H+1):
  for j in range(N):
    if j == 0:
      if ls[j][0] <= i:
        dp[i] = dp[i-ls[j][0]] + ls[j][1]
      else:
        dp[i] = ls[j][1]    
    else:
      if ls[j][0] <= i:
        dp[i] = min([dp[i], dp[i-ls[j][0]] + ls[j][1]])
      else:
        dp[i] = min([dp[i], ls[j][1]])
        
print(dp[H])
Buggy python submission (verdict: Time Limit Exceeded):
print(sum(range(int(input()))))

Fixed submission:
print(sum(range(int(input()))))
Buggy python submission (verdict: Runtime Error):
H, W = map(int,input().split())
List = [list("." +input()+ ".") for i in range(H)]
B = ["."]*(W+2)
List.insert(0,B)
List.append(B)

for i in range(1,W+1):
  for j in range(1,H+1):
    if List[i][j]=="#" and List[i-1][j]==List[i][j-1]\
        ==List[i][j+1]==List[i+1][j]==".":
      print("No")
      break
  else:
    continue
  break  

else:print("Yes")

Fixed submission:
H, W = map(int,input().split())
List = [list("." +input()+ ".") for i in range(H)]
B = ["."]*(W+2)
List.insert(0,B)
List.append(B)

for i in range(1,H+1):
  for j in range(1,W+1):
    if List[i][j]=="#" and List[i-1][j]==List[i][j-1]\
        ==List[i][j+1]==List[i+1][j]==".":
      print("No")
      break
  else:
    continue
  break  

else:print("Yes")
Buggy python submission (verdict: Runtime Error):
n, k = input().split()
n = int(n)
k = int(k)
listnum = []
newlist = []
sumnum = 0
for a in range(n):
    listnum.append(int(input())
newlist = sorted(listnum)
for b in range(k):
    sumnum = sumnum + list[0]
print(sumnum)

Fixed submission:
n, k = input().split()
n = int(n)
k = int(k)
listnum = input().split()
newlist = []
sumnum = 0

listnum = [int(n) for n in listnum]
newlist = sorted(listnum)
for b in range(k):
    sumnum = sumnum + newlist[b]
print(sumnum)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
INF = int(1e18)
ans = 1
for i in range(N): ans*=A[i]
if(ans>INF): print(-1)
else: print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
INF = int(1e18)
ans = 1
for i in range(N):
  if(A[i]==0):
    print(0)
    exit()
for i in range(N):
  ans*=A[i]
  if(ans>INF):
    print(-1)
    exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
if __name__ == "__main__":
    a, b, c, d=(int(x) for x in input().split())
    arr = [a*c, a*d, b*c, b*d]
    print(arr.max())

Fixed submission:
import numpy as np
if __name__ == "__main__":
    a, b, c, d=(int(x) for x in input().split())
    arr = np.array([a*c, a*d, b*c, b*d])
    print(arr.max())
Buggy python submission (verdict: Runtime Error):
_input = input()
number = _input.split()
N = number[0]
R = number[1]
if N<10:
  R += 100 * (10-N)
print(R)
            

Fixed submission:
_input = input()
number = _input.split()
N = int(number[0])
R = int(number[1])
if N<10:
  R += 100 * (10-N)
print(R)

Buggy python submission (verdict: Runtime Error):
import os
import sys
import numpy 

if _name_=='__main__':
  _input = input()
  _input = _input.split()
  N = _input[0]
  R = _input[1]
  if N<10:
    R -= 100 * (10-N)
  print(R)

Fixed submission:
_input = input()
number = _input.split()
N = int(number[0])
R = int(number[1])
if N<10:
  R += 100 * (10-N)
print(R)
Buggy python submission (verdict: Runtime Error):
s=input()
c=0
if(s[0]=='o')c+=700
if(s[1]=='o')c+=100
if(s[2]=='o')c+=100
print(c)

Fixed submission:
s=input()
ans=700
for i in s:
  if i=='o':
    ans+=100
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mat = lambda x, y, v: [[v]*y for _ in range(x)]
ten = lambda x, y, z, v: [mat(y, z, v) for _ in range(x)]
mod = 1000000007
sys.setrecursionlimit(1000000)

N, K = rl()
A = rl()

heap = []
for a in A:
	heappush(heap, (-a, 1))

while heap:
	a, n = heappop(heap)
	a = -a
	if K > 0:
		K -= 1
		a = a*n/(n+1)
		heappush(heap, (-a, n+1))
	else:
		heappush(heap, (-a, n))
		break
print(math.ceil(-heap[0][0]))


Fixed submission:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mat = lambda x, y, v: [[v]*y for _ in range(x)]
ten = lambda x, y, z, v: [mat(y, z, v) for _ in range(x)]
mod = 1000000007
sys.setrecursionlimit(1000000)

N, K = rl()
A = rl()

def is_ok(x):
	s = 0
	for a in A:
		s += math.ceil(a / x)-1
	return s <= K

l, r = 0, 10**9
while r-l > 1:
	m = (r+l)//2
	if is_ok(m):
		r = m
	else:
		l = m
print(r)
Buggy python submission (verdict: Time Limit Exceeded):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

K = ri()
S = rs()

class CombMod:
    def __init__(self, N):
        self.fact = [1]
        self.rfact = [1]
        for i in range(1, N+1):
            self.fact.append(self.fact[i-1]*i % mod)
            self.rfact.append(pow(self.fact[i], mod-2, mod))

    def comb(self, n, k):
        return self.fact[n]*self.rfact[k]*self.rfact[n-k] % mod

N = len(S)
cm = CombMod(K+N)

ans = 0
for i in range(K+1):
	ans += cm.comb(K+N-i-1, N-1) * pow(26, i, mod) * pow(25, K-i, mod)
	ans = ans % mod
print(ans)


Fixed submission:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

K = ri()
S = rs()

class CombMod:
    def __init__(self, N):
        self.fact = [1]
        self.rfact = [1]
        for i in range(1, N+1):
            self.fact.append(self.fact[i-1]*i % mod)
            self.rfact.append(pow(self.fact[i], mod-2, mod))

    def comb(self, n, k):
        return self.fact[n]*self.rfact[k]*self.rfact[n-k] % mod

N = len(S)
cm = CombMod(K+N)

pows = [1]
pows2 = [1]
p = 1
p2 = 1
for i in range(K+1):
	p = (p * 25) % mod
	p2 = (p2 * 26) % mod
	pows.append(p)
	pows2.append(p2)
#print(pows)
ans = 0
for i in range(K+1):
	#ans += cm.comb(K+N-i-1, N-1) * pow(26, i, mod) * pow(25, K-i, mod)
	ans += cm.comb(K+N-i-1, N-1) * pows2[i] * pows[K-i]
	ans = ans % mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7


def get_divisors(n):
    divs = []
    for i in range(2, int(n**0.5)+1):
        c = 0
        while n % i == 0:
            n = n // i
            c += 1
        if c > 0:
            divs.append((i, c))
    if n > 1:
        divs.append((n, 1))
    return divs

N = ri()
A = rl()

import collections
H = collections.defaultdict(set)
D = []
for i, a in enumerate(A):
	divs = get_divisors(a)
	D.append(divs)
	for d, c in divs:
		for j in range(1, c+1):
			k = pow(d, j)
			H[k].add(i)

del_list = set()
for i, divs in enumerate(D):
	s = set(range(N))
	for d, c in divs:
		for j in range(1, c+1):
			k = pow(d, j)
			s &= H[k]
	del_list |= s - set([i])
print(N-len(del_list))


Fixed submission:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
A = rl()

A.sort()
m = A[-1]

import collections
h = collections.Counter(A)

ans = 0
for a in A:
	if h[a] == 0:
		continue
	if h[a] == 1:
		ans += 1
	for j in range(a, m+1, a):
		h[j] = 0
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

T = rs()

ans = ''
for i, c in enumerate(T):
	if c == '?':
		if i < len(T)-1 and T[i+1] == 'D':
			ans += 'P'
		else:
			ans += 'D'
	else:
		ans += c
print(ans)


Fixed submission:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

T = rs()

A = list(T)
l = len(A)

for i, c in enumerate(A):
	if c == '?':
		A[i] = 'D'
print(''.join(A))
Buggy python submission (verdict: Time Limit Exceeded):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
#mod = 10**9 + 7
mod = 998244353

N, M, K = rl()

def combmod(n, k):
	p, q = 1, 1
	for i in range(1, k+1):
		p = p * (n-i+1) % mod
		q = q * i % mod
	return p * pow(q, mod-2, mod) % mod

ans = 0
for k in range(K+1):
	ans = (ans + M * pow(M-1, N-1-k, mod) * combmod(N-1, k)) % mod
print(ans)


Fixed submission:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
#mod = 10**9 + 7
mod = 998244353

N, M, K = rl()

class CombMod:
	def __init__(self, N):
		self.fact = [1]
		self.rfact = [1]
		for i in range(1, N+1):
			self.fact.append(self.fact[i-1]*i % mod)
			self.rfact.append(pow(self.fact[i], mod-2, mod))

	def comb(self, n, k):
		return self.fact[n]*self.rfact[k]*self.rfact[n-k] % mod

cm = CombMod(N-1)

ans = 0
for k in range(K+1):
	ans = (ans + M * pow(M-1, N-1-k, mod) * cm.comb(N-1, k)) % mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

X = ri()

def get_divisors(X):
	if X == 1:
		return [1]
	i = 2
	div = []
	while i*i <= X:
		if X % i == 0:
			X //= i
			div.append(i)
		else:
			i += 1
	if X > 1:
		div.append(X)
	return div

#for i in range(1, 10):
#	print(i, get_divisors(i))

def f(x, y):
	# x**4+y**4+x**2*y**2 + x**3*y+x*y**3
	return (y**4+x*y**3+x**2*y**2+x**3*y+x**4) * (x-y)

def search(d):
	y = 0
	while True:
		x = y+d
		v = f(x, y)
		#print(v)
		#print(x, y, v)
		if v == X:
			print(x, y)
			exit()
		if v > X:
			break
		y += 1
	y = -1
	while True:
		x = y+d
		if x <= 0:
			break
		v = f(x, y)
		#print(x, y, v)
		if v == X:
			print(x, y)
			exit()
		if v <= 0:
			break
		y -= 1

import itertools
def comb(divs):
	for i in range(1, len(divs)+1):
		for c in itertools.combinations(divs, i):
			m = 1
			for n in c:
				m *= n
			yield m

divs = get_divisors(X)
#print(divs)
visited = {}
for d in comb(divs):
#for d in set(divs):
	if d in visited: continue
	search(d)
	visited[d] = 1



Fixed submission:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

X = ri()

for a in range(-200, 200):
	for b in range(-200, a):
		if a**5 - b**5 == X:
			print(a, b)
			exit()
Buggy python submission (verdict: Time Limit Exceeded):
import sys, math
from pprint import pprint
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

S = rs()

mods = []
n = 0
r = 0
e = 0
for i in reversed(range(len(S))):
	#n = int(S[i:])
	n += int(S[i]) * 10**e
	e += 1
	m = n % 2019
	mods.append(m)
mods.append(0)
import collections
cnt = collections.Counter(mods)
ans = 0
for k, c in cnt.items():
	ans += c*(c-1)//2
print(ans)


Fixed submission:
import sys, math
from pprint import pprint
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

S = rs()

mods = []
n = 0
e = 1
for i in reversed(range(len(S))):
	n += int(S[i]) * e
	e = (e*10) % 2019
	n = n % 2019
	mods.append(n)
mods.append(0)
import collections
cnt = collections.Counter(mods)
ans = 0
for k, c in cnt.items():
	ans += c*(c-1)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys, math
from pprint import pprint
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

S = rs()

mods = []
n = 0
e = 0
r = 0
for i in reversed(range(len(S))):
	n = int(S[i:])
	r = 2019
	m = n % r
	mods.append(m)
mods.append(0)
import collections
cnt = collections.Counter(mods)
ans = 0
for k, c in cnt.items():
	ans += c*(c-1)//2
print(ans)


Fixed submission:
import sys, math
from pprint import pprint
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

S = rs()

mods = []
n = 0
e = 1
for i in reversed(range(len(S))):
	n += int(S[i]) * e
	e = (e*10) % 2019
	n = n % 2019
	mods.append(n)
mods.append(0)
import collections
cnt = collections.Counter(mods)
ans = 0
for k, c in cnt.items():
	ans += c*(c-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import collections
input = sys.stdin.readline
 
N = int(input())
 
for c in str(N):
	if c == '7':
		print('Yes')
		exit(1)
print('No')

Fixed submission:
import sys
import collections
input = sys.stdin.readline

N = int(input())

flag = False
for c in str(N):
	if c == '7':
		flag = True
if flag:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
import sys
import collections
input = sys.stdin.readline

N = int(input())

for c in str(N):
	if c == '7':
		print('Yes')
		exit(1)
print('No')


Fixed submission:
import sys
import collections
input = sys.stdin.readline

N = int(input())

flag = False
for c in str(N):
	if c == '7':
		flag = True
if flag:
	print('Yes')
else:
	print('No')