Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

if T.startwith('S'):
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
T = input()

if T.startswith(S):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
a = [0]*n
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for l in A:
        a[l-1] = 1
print(a.count(0))


Fixed submission:
N, K = map(int, input().split())
a = [0]*N
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for l in A:
        a[l-1] = 1
print(a.count(0))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
a = [0]*n
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    A.sort()
    for l in A:
        a[l-1] = 1
print(a.count(0))


Fixed submission:
N, K = map(int, input().split())
a = [0]*N
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for l in A:
        a[l-1] = 1
print(a.count(0))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
a = [0]*n
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    A.sort()
    for l in L:
        a[l-1] = 1
print(a.count(0))


Fixed submission:
N, K = map(int, input().split())
a = [0]*N
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for l in A:
        a[l-1] = 1
print(a.count(0))
Buggy python submission (verdict: Runtime Error):
s = input(:)
w = input(:)
S = int(s)
W = int(w)
if S<=W:
  print("unsafe")
else:
  print("safe")

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

if S <= W:
    print("unsafe")
else:
    print("safe")

Buggy python submission (verdict: Runtime Error):
s = input(:)
w = input(:)
S = int(s)
W = int(w)
if S>=W:
  print("unsafe")
else:
  print("safe")

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

if S <= W:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
A = list(map(int, input().split()))
A.sort()
a = A[0]
b = A[1]
ans = a

for i in range(1, b-a+1):
    ans *= a + i
    i += 1

if ans > 0:
    print("Positive")
elif ans < 0:
    print("Negative")
else:
    print("Zero")    


Fixed submission:
A = list(map(int, input().split()))
A.sort()
a = A[0]
b = A[1]
c = b-a

if a <= 0 <= b:
    print("Zero")

elif a > 0:
    print("Positive")

elif b < 0:
    if c%2 == 1:
        print("Positive")
    else:
        print("Negative")
Buggy python submission (verdict: Runtime Error):
*a = map(int,input().split())
print(max(a) - min(a))


Fixed submission:
*a, = map(int,input().split())
print(max(a) - min(a))

Buggy python submission (verdict: Runtime Error):
*a = map(int,input.split())
print(max(a) - min(a))


Fixed submission:
*a, = map(int,input().split())
print(max(a) - min(a))
Buggy python submission (verdict: Runtime Error):
a = map(int,input())
a % 3 = b
print((a-b)/3)

Fixed submission:
a = int(input())
b = a % 3
print(int((a - b) / 3))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")

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

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")

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

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
count = 0
a = str(input())
print(a)
for i in range(len(a))
if a[i] == 1:
    count = count + 1

Fixed submission:
print(int(input()) % 9)

Buggy python submission (verdict: Runtime Error):

count = 0
s = [input() for i in range(0,3)] #複数行の数値の入力を取得

if s[i]=1:
    count += 1
    
else:
    count = count

Fixed submission:
print(int(input()) % 9)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = input()
print("Yes if a == b == c or b == c ==d else "No")

Fixed submission:
a,b,c,d = input()
if a == b == c or b == c == d:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a, b, c, d = input()
print("Yes" if a = b = c or b = c = d else "No")

Fixed submission:
a,b,c,d = input()
if a == b == c or b == c == d:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a, *b, c = input()
print(a + str(len(b) + c)

Fixed submission:
a, *b, c = input()
print(a + str(len(b)) + c)
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
if a == b:
print("H")
else:
print("D")

Fixed submission:
a,_,b = input()
if a == b:
    print("H")
else:
    print("D")
Buggy python submission (verdict: Runtime Error):
a = input()
print(a.replace(',' , ' ')

Fixed submission:
a,b,c = input().split(",")
print(a, b, c)

Buggy python submission (verdict: Runtime Error):
a = input()
print(a.replace(',' , ' ')

Fixed submission:
a,b,c = input().split(",")
print(a, b, c)

Buggy python submission (verdict: Runtime Error):
s = input()
print(s.replace(',', ' '))
a = input()
print(a.replace(',' , ' ')

Fixed submission:
a,b,c = input().split(",")
print(a, b, c)

Buggy python submission (verdict: Runtime Error):
print(*input().split(',')

Fixed submission:
a,b,c = input().split(",")
print(a, b, c)

Buggy python submission (verdict: Runtime Error):
print(*input.split(",")

Fixed submission:
a,b,c = input().split(",")
print(a, b, c)

Buggy python submission (verdict: Runtime Error):
a, b, c = input.split(",")
print(a,b,c)

Fixed submission:
a,b,c = input().split(",")
print(a, b, c)

Buggy python submission (verdict: Runtime Error):
a, b, c = input.split(",")
print(a, b, c)

Fixed submission:
a,b,c = input().split(",")
print(a, b, c)
Buggy python submission (verdict: Runtime Error):
x = int(input())
bool ok=False
for i in range 9:
	for j in range 9:
		if(i*j==x):
			ok=True
if(ok):print("Yes")
else: print("No")

Fixed submission:
x = int(input())
ok = False
for i in range(1,10):
	for j in range(1,10):
		if i*j==x :
			ok=True
if ok :print("Yes")
else: print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=0
b=0
c=0
d=0
for i in range(n):
  s=input()
  if s=="AC":
    a=a+1
  if s=="WA":
    b=b+1
  if s=="TLE":
    c=c+1
  if s=="RE":
    d=d+1
print("AC*a""WA*b""TLE*c""RE*d)


Fixed submission:
n=int(input())
if n%1000==0:
  print(0)
else:
  print((n//1000+1)*1000-n)
Buggy python submission (verdict: Runtime Error):
k=int(input())
s=input()
if len(s)<=k:
  print(s)
else:
  print(s[:s]+"...")

Fixed submission:
k=int(input())
s=input()
if len(s)<=k:
  print(s)
else:
  print(s[:k]+"...")
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a%d>0:
   a=a//d+1
elif a%d==0:
   a=a//d
if c%b>0:
   c=c//b+1
elif c%b==0
if a>=c:
   print("yes")
else:
   print("no")

Fixed submission:
a,b,c,d=map(int,input().split())
if a%d>0:
   a=a//d+1
elif a%d==0:
   a=a//d
if c%b>0:
  c=c//b+1
elif c%b==0:
  c=c//b
if a>=c:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
h,a=map(int,input.split())
if h>a:
  print(h//a)
if h<=a:
  print(1)

Fixed submission:
h,a=map(int,input().split())
if h>a:
  if h%a==0:print(h//a)
  if h%a>0:print(h//a+1)
if h<=a:
  print(1)

Buggy python submission (verdict: Runtime Error):
h,a=map(int,input.split())
if h>a:
  print(h//a)
if h<a:
  print(1)

Fixed submission:
h,a=map(int,input().split())
if h>a:
  if h%a==0:print(h//a)
  if h%a>0:print(h//a+1)
if h<=a:
  print(1)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
if n == m
   print("Yes")
else:
   print("No")


Fixed submission:
n,m=map(int,input().split())
if n==m:
   print("Yes")
else:
   print("No")

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
if n==m
   print("Yes")
else:
   print("No")

Fixed submission:
n,m=map(int,input().split())
if n==m:
   print("Yes")
else:
   print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
for x in range(1, 10)
  for y in range(1, 10)
    if x * y == n:
      print("Yes")
      exit()
print("No")
  

Fixed submission:
n = int(input())
for x in range(1, 10):
  for y in range(x, 10):
    if x * y == n:
      print("Yes")
      exit()
print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
for x in range(1, 10)
  for y in range(x, 10)
    if x * y == n:
      print("Yes")
      exit()
print("No")
  

Fixed submission:
n = int(input())
for x in range(1, 10):
  for y in range(x, 10):
    if x * y == n:
      print("Yes")
      exit()
print("No")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b>a:if b%a>0:print(b//a+1)
elif b<=a:print(1)
else:print(b//a)

Fixed submission:
a,b=map(int,input().split())
if (b-1)%(a-1)>0:
  print((b-1)//(a-1)+1)
if (b-1)%(a-1)==0:
  print((b-1)//(a-1))

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b%a>0:print(b//a+1)
elif a=b:print(1)
else:print(b//a)

Fixed submission:
a,b=map(int,input().split())
if (b-1)%(a-1)>0:
  print((b-1)//(a-1)+1)
if (b-1)%(a-1)==0:
  print((b-1)//(a-1))
Buggy python submission (verdict: Runtime Error):
a, b = map(imt, input().split())
print(max(a + b, a * b, a - b))

Fixed submission:
a, b = map(int, input().split())
print(max(a + b, a * b, a - b))
Buggy python submission (verdict: Runtime Error):
a, b = map(imt, input().split())
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")


Fixed submission:
a, b = map(int, input().split())
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
x, a, b = map(int, input.split())
print("A" if max(x, a) - min(x, a) < max(x, b) - min(x, b) else "B")

Fixed submission:
x, a, b = map(int, input().split())
print("A" if max(x, a) - min(x, a) < max(x, b) - min(x, b) else "B")
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = 0
mn = 101
for i in range(n):
  s = int(input())
  x += s
  if x % 10 != 0
    if s < mn:
      mn = s
if x % 10 != 0:
  print(x)
else:
  x -= mn
  if x % 10 == 0:
    print(0)
  else:
    if x < 0:
      print(0)
      exit()
    print(x)
        

Fixed submission:
n = int(input())
x = 0
mn = 100
for i in range(n):
  s = int(input())
  x += s
  if s % 10 != 0:
    if s <= mn:
      mn = s
if x % 10 != 0:
  print(x)
else:
  x -= mn
  if x % 10 == 0:
    print(0)
  else:
    if x < 0:
      print(0)
      exit()
    print(x)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = 0
mn = 101
for i in range(n):
    s = int(input())
    x += s
    if x % 10 != 0
        if s < mn:
            mn = s
if x % 10 != 0:
    print(x)
else:
    x -= mn
    if x % 10 == 0:
        print(0)
    else:
        if x < 0:
            print(0)
            exit()
        print(x)
        

Fixed submission:
n = int(input())
x = 0
mn = 100
for i in range(n):
  s = int(input())
  x += s
  if s % 10 != 0:
    if s <= mn:
      mn = s
if x % 10 != 0:
  print(x)
else:
  x -= mn
  if x % 10 == 0:
    print(0)
  else:
    if x < 0:
      print(0)
      exit()
    print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
    
p = max(s)
for i in s:
    if i != p:
        print(p)
    else:
        s.remove(p)
        print(max(s))
        s.insert(0,p)


Fixed submission:
n = int(input())
s = []
p = []
for i in range(n):
    s.append(int(input()))
    
p = s[:] 
s.sort()
for i in p:
    if i != s[-1]:
        print(s[-1])
    else:
        print(s[-2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
for i in range(n):
    p = s.pop(i)
    print(max(s))
    s.insert(i,p)

Fixed submission:
n = int(input())
s = []
p = []
for i in range(n):
    s.append(int(input()))
    
p = s[:] 
s.sort()
for i in p:
    if i != s[-1]:
        print(s[-1])
    else:
        print(s[-2])
Buggy python submission (verdict: Runtime Error):
ans = 0 if x < a else 10
print(ans)

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

if X < A:
    print(0)
elif X >= A:
    print(10)

Buggy python submission (verdict: Runtime Error):
ans = 0 if x < a else 10
print(ans)

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

if X < A:
    print(0)
elif X >= A:
    print(10)
Buggy python submission (verdict: Runtime Error):
z = [int(i) for i in input().split()]
l = z[0]
r = z[1]
if l == 2019 or r == 2019 :
  print(0)
elif r < 2019 :
  max1 = 0 
  for i in range(l,r+1):
    for j in range(i,r+1):
      	temp = (i%2019)*(j%2019)
        if temp > max1:
          max1 = temp
  print(max1)        
                   
    
elif r > 2019 and l > 2019 :
  flag = 0 
  if l - r >= 2019:
    print(0)
  else:
    max1 = 0 
    for i in range(l,l+2020):
      for j in range(i,l+2020):
          temp = (i%2019)*(j%2019)
          if temp > max1:
            max1 = temp
    print(max1)        
                   
    
    
  

Fixed submission:
list1 = [int(i) for i in input().split()]
l = list1[0]
r = list1[1]
if (l// 2019 != r//2019):
	print(0)
else:
	max1 = 10000000000
	if l - r >= 2019:
		for i in range(l,l+2020):
			for j in range(i+1,l+2020):
				temp = ((i%2019)*(j%2019))%2019
				if temp < max1 :
					max1 = temp
	else :
		for i in range(l,r+1):
			for j in range(i+1,r+1):
				temp = ((i%2019)*(j%2019))%2019
			
				if temp < max1 :
					max1 = temp
		
	print(max1)

Buggy python submission (verdict: Runtime Error):
z = [int(i) for i in input().split()]
l = z[0]
r = z[1]
if l == 2019 or r == 2019 :
  print(0)
elif r < 2019 :
  print(l*(l+1))
elif r > 2019 and l > 2019 :
  flag = 0 
  if l - r >= 2019:
    for i in range(l,l+2020):
      if i%2019 == 0:
        number = i 
        flag = 1 
        break
	if flag == 1 :
		print(0)
	else :
    	print((number%2019)*((number+1)%2019)    
  else :
    for i in range(l,r+1):
      if i % 2019 == 0 :
       	flag = 1 
        break
	  if flag == 1 :
	    print(0)
	  else :
	    print( (l%2019)*((l+1)%2019))

Fixed submission:
list1 = [int(i) for i in input().split()]
l = list1[0]
r = list1[1]
if (l// 2019 != r//2019):
	print(0)
else:
	max1 = 10000000000
	if l - r >= 2019:
		for i in range(l,l+2020):
			for j in range(i+1,l+2020):
				temp = ((i%2019)*(j%2019))%2019
				if temp < max1 :
					max1 = temp
	else :
		for i in range(l,r+1):
			for j in range(i+1,r+1):
				temp = ((i%2019)*(j%2019))%2019
			
				if temp < max1 :
					max1 = temp
		
	print(max1)

Buggy python submission (verdict: Runtime Error):
z = [int(i) for i in input().split()]
l = z[0]
r = z[1]
if l == 2019 or r == 2019 :
  print(0)
elif r < 2019 :
  print(l*(l+1))
elif r > 2019 and l > 2019 :
  flag = 0 
  if l - r >= 2019:
    for i in range(l,l+2020):
      if i%2019 == 0:
        number = i 
        flag = 1 
        break
  else :
    for i in range(l,r+1):
      if i % 2019 == 0 :
       	flag = 1 
        break
  if flag == 1 :
    print(0)
  else :
    print(l*(l+1)
   
      
  
  

Fixed submission:
list1 = [int(i) for i in input().split()]
l = list1[0]
r = list1[1]
if (l// 2019 != r//2019):
	print(0)
else:
	max1 = 10000000000
	if l - r >= 2019:
		for i in range(l,l+2020):
			for j in range(i+1,l+2020):
				temp = ((i%2019)*(j%2019))%2019
				if temp < max1 :
					max1 = temp
	else :
		for i in range(l,r+1):
			for j in range(i+1,r+1):
				temp = ((i%2019)*(j%2019))%2019
			
				if temp < max1 :
					max1 = temp
		
	print(max1)
Buggy python submission (verdict: Runtime Error):
s = input()
alpha = [0]*26
for i in range(len(s)):
	alpha[ord(s[i]) - ord('a') ] += 1
if alpha['k' - 'a'] == 1:
	alpha['i' - 'a'] == 1:
		alpha['h' - 'a'] == 1:
			alpha['b' - 'a'] == 1:
				alpha['r' - 'a'] == 1:
					print("YES")
else:
	print("NO")

Fixed submission:
s = input()
alpha = [0]*26
l = []
l.append('KIHBR')
l.append('AKIHBR')
l.append('KIHABR')
l.append('KIHBAR')
l.append('KIHBRA')

l.append('AKIHABR')
l.append('AKIHBAR')
l.append('AKIHBRA')
l.append('KIHABAR')
l.append('KIHABRA')
l.append('KIHBARA')
l.append('AKIHABAR')
l.append('KIHABARA')
l.append('AKIHBARA')
l.append('AKIHABRA')
l.append('AKIHABARA')
if s in l:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
N = int(input())
num = list(map(int,input().split()))
b= 1
for a in range(N):
  b = b * num[a]
  if b > 10**18:
    print(-1)
  else:
    print(b)

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

Buggy python submission (verdict: Runtime Error):
N = int(input())
num = list(map(int,input().split()))
b= 0
for a in range(N):
  b = b * num[a]
  if b > 10**18:
    print('-1')
  else:
    print(b)

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

Buggy python submission (verdict: Runtime Error):
N = int(input())
num = list(map(int,input().split()))
b= 0
for a in range(N):
  b = b * num[a]
if b > 10**18:
  print('-1')
else:
  print(b)

Fixed submission:
a,b = map(int,input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
enshu = int(input(R))
print(enshu * 2 * 3.1415)


Fixed submission:
enshu = int(input())
print(enshu * 2 *3.141592)

Buggy python submission (verdict: Runtime Error):
enshu = int(input(R))
print(enshu * 2 *3.141592)



Fixed submission:
enshu = int(input())
print(enshu * 2 *3.141592)
Buggy python submission (verdict: Time Limit Exceeded):
import math

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

is_prime = [1] * 1000001
D = [0] * 1000001

for i in range(2, 1001):
    if is_prime[i]:
        D[i] = i
        j = 2 * i
        while j <= 1000000:
            if is_prime[j]:
                D[j] = i
                is_prime[j] = 0
            j += i
for i in range(1001, 1000001):
    if is_prime[i]:
        D[i] = i

count = [0] * 1000001
for a in A:
    k = a
    pre = 0
    while k != 1:
        if pre != D[k]:
            count[D[k]] += 1
        pre = D[k]
        k = int(k / D[k])

ans = 'pairwise coprime'
for x in count:
    if x == N:
        print('not coprime')
        exit()
    if x > 1:
        ans = 'setwise coprime'
print(ans)


Fixed submission:
import math

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

g = 0
for a in A:
    g = math.gcd(g, a)
if g != 1:
    print('not coprime')
    exit()

is_prime = [1] * 1000001
D = [0] * 1000001

for i in range(2, 1001):
    if is_prime[i]:
        D[i] = i
        j = 2 * i
        while j <= 1000000:
            if is_prime[j]:
                D[j] = i
                is_prime[j] = 0
            j += i
for i in range(1001, 1000001):
    if is_prime[i]:
        D[i] = i

count = [0] * 1000001
for a in A:
    k = a
    pre = 0
    while k != 1:
        if pre != D[k]:
            count[D[k]] += 1
            if count[D[k]] == 2:
                print('setwise coprime')
                exit()
        pre = D[k]
        k = int(k / D[k])
print('pairwise coprime')

Buggy python submission (verdict: Time Limit Exceeded):
import math
X = [0] * 1000000

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

for a in A:
    m = int(math.sqrt(a))
    for i in range(2, m + 1):
        if a % i == 0:
            X[i] += 1
        while a % i == 0:
            a /= i
    a = int(a)
    if a != 1:
        X[a] += 1

ans = 'pairwise coprime'
for x in X:
    if x == N:
        print('not coprime')
        exit()
    if x > 1:
        ans = 'setwise coprime'
print(ans)


Fixed submission:
import math

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

g = 0
for a in A:
    g = math.gcd(g, a)
if g != 1:
    print('not coprime')
    exit()

is_prime = [1] * 1000001
D = [0] * 1000001

for i in range(2, 1001):
    if is_prime[i]:
        D[i] = i
        j = 2 * i
        while j <= 1000000:
            if is_prime[j]:
                D[j] = i
                is_prime[j] = 0
            j += i
for i in range(1001, 1000001):
    if is_prime[i]:
        D[i] = i

count = [0] * 1000001
for a in A:
    k = a
    pre = 0
    while k != 1:
        if pre != D[k]:
            count[D[k]] += 1
            if count[D[k]] == 2:
                print('setwise coprime')
                exit()
        pre = D[k]
        k = int(k / D[k])
print('pairwise coprime')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
l = sys.stdin.readline().strip()
N, M, K = map(int, l.split())
comb_quick = {}
mod = 998244353
C = [1]
for i in range(1, (N-1) // 2 + 2):
    next = C[-1] * (N-i) // i
    C.append(next)

res = 0

exp_quick = [1]
for i in range(N):
    exp_quick.append(exp_quick[-1] * (M-1) % mod)

for x in range(0,K+1):
    crt =  exp_quick[N-x-1] * M
    crt %= mod
    #print("start")
    idx = min(x, N-1-x)
    crt *= C[idx]
    #print("end")
    crt %= mod
    res += crt
    res %= mod

print(res)

Fixed submission:
import sys
l = sys.stdin.readline().strip()
N, M, K = map(int, l.split())
comb_quick = {}
mod = 998244353
C = [1]
for i in range(1, (N-1) // 2 + 2):
    next = C[-1] * (N-i) * pow(i, mod-2, mod)
    C.append(next % mod)

res = 0

for x in range(K+1):
    crt =  (pow(M-1, N-x-1, mod) * M) % mod 
    crt %= mod
    #print("start")
    idx = min(x, N-1-x)
    crt *= C[idx]
    #print("end")
    crt %= mod
    res += crt
    res %= mod

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
l = sys.stdin.readline().strip()
N, M = map(int, l.split())
link = []
for i in range(N+1):
    link.append([-1] * (N+1))

l = sys.stdin.readline().strip()
heights = [-1] + list(map(int, l.split()))

for i in range(M):
    l = sys.stdin.readline().strip()
    A, B = map(int, l.split())
    if A!= B:
        link[A][B] = 1
        link[B][A] = 1

count = 0
impossible = set()
for i in range(1, N+1):
    if i in impossible:
        continue
    hs = []
    his = []
    for j in range(1, N+1):
        if link[i][j] == 1:
            hs.append(heights[j])
            his.append(j)
    if hs ==[]:
        count += 1
        continue

    if heights[i] > max(hs):
        count += 1
        for one in his:
            impossible.add(one)
print(count)



Fixed submission:
import sys
l = sys.stdin.readline().strip()
N, M = map(int, l.split())
impossible = set()

l = sys.stdin.readline().strip()
heights = [-1] + list(map(int, l.split()))

for i in range(M):
    l = sys.stdin.readline().strip()
    A, B = map(int, l.split())
    if A==B:
        continue
    if heights[A] == heights[B]:
        impossible.add(A)
        impossible.add(B)
    elif heights[A] < heights[B]:
        impossible.add(A)
    else:
        impossible.add(B)

print (N - len(impossible))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
l = sys.stdin.readline().strip()
N = int(l)
l = sys.stdin.readline().strip() 
a = list(map(int, l.split()))
count = 0
for i in range(N):
    for j in range(i+1, N):
        if j - i == a[j] + a[i]:
            count += 1

print(count)

Fixed submission:
import sys
l = sys.stdin.readline().strip()
N = int(l)
l = sys.stdin.readline().strip() 
a = list(map(int, l.split()))
count = 0
# j - i = Ai + Aj -> Ai +i = j - Aj
# Li = Ai + i
# Ri = j - Aj
L = []
R = []
for i, one in enumerate(a):
    L.append(one + i+1)
    if (i+1 - one) > 0:
        R.append(i+1-one)
L = sorted(L)
R_count = {}
for one in R:
    if one in R_count:
        R_count[one] += 1
    else:
        R_count[one] = 1
count = 0
for one in L:
    if one in R_count:
        count += R_count[one]

print(count)