Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
mod = 998244353
n = int(input())
d = list(map(int,input().split()))
if d[0]!=0 or d[1:].count(0)!=0:
  print(0)
  exit()
l = [0 for i in range(n-1)]
for i in d:
  l[i] += 1
cou = 1
if 0 in l:
  a = l.index(0)
  if sum(l[a:])!=0:
    print(0)
    exit()
for i in range(n-2):
  if l[i+1]!=0:
    a = l[i]
    b = l[i+1]
    cou *= (a**b)%mod
print(cou%mod)

Fixed submission:
mod = 998244353
n = int(input())
d = list(map(int,input().split()))
if d[0]!=0 or d[1:].count(0)!=0:
  print(0)
  exit()
l = [0 for i in range(n)]
for i in d:
  l[i] += 1
cou = 1
if 0 in l:
  a = l.index(0)
  if sum(l[a:])!=0:
    print(0)
    exit()
for i in range(n-2):
  if l[i+1]!=0:
    a = l[i]
    b = l[i+1]
    cou *= (a**b)%mod
print(cou%mod)

Buggy python submission (verdict: Runtime Error):
mod = 998244353
n = int(input())
d = list(map(int,input().split()))
if d[0]!=0 or d[1:].count(0)!=0:
  print(0)
  exit()
l = [0 for i in range(n-1)]
for i in d:
  l[i] += 1
cou = 1
for i in range(n-2):
  if l[i+1]!=0:
    a = l[i]
    b = l[i+1]
    cou *= (a**b)%mod
  else:
    if l[i+1:].count(0)!=n-2-i:
      print(0)
      exit()
print(cou%mod)

Fixed submission:
mod = 998244353
n = int(input())
d = list(map(int,input().split()))
if d[0]!=0 or d[1:].count(0)!=0:
  print(0)
  exit()
l = [0 for i in range(n)]
for i in d:
  l[i] += 1
cou = 1
if 0 in l:
  a = l.index(0)
  if sum(l[a:])!=0:
    print(0)
    exit()
for i in range(n-2):
  if l[i+1]!=0:
    a = l[i]
    b = l[i+1]
    cou *= (a**b)%mod
print(cou%mod)

Buggy python submission (verdict: Runtime Error):
mod = 998244353
n = int(input())
d = list(map(int,input().split()))
if d[0]!=0 or d[1:].count(0)!=0:
  print(0)
  exit()
l = [0 for i in range(n-1)]
for i in d:
  l[i] += 1
cou = 1
for i in l:
  if i!=0:
    cou *= (i%mod)
print(cou%mod)

Fixed submission:
mod = 998244353
n = int(input())
d = list(map(int,input().split()))
if d[0]!=0 or d[1:].count(0)!=0:
  print(0)
  exit()
l = [0 for i in range(n)]
for i in d:
  l[i] += 1
cou = 1
if 0 in l:
  a = l.index(0)
  if sum(l[a:])!=0:
    print(0)
    exit()
for i in range(n-2):
  if l[i+1]!=0:
    a = l[i]
    b = l[i+1]
    cou *= (a**b)%mod
print(cou%mod)

Buggy python submission (verdict: Runtime Error):
mod = 998244353
n = int(input())
d = list(map(int,input().split()))
if d[0]!=0 or d[1:].count(0)!=0:
  print(0)
  exit()
l = [0 for i in range(n-1)]
for i in d:
  l[i] += 1
cou = 1
for i in l:
  cou *= (i%mod)
print(cou%mod)

Fixed submission:
mod = 998244353
n = int(input())
d = list(map(int,input().split()))
if d[0]!=0 or d[1:].count(0)!=0:
  print(0)
  exit()
l = [0 for i in range(n)]
for i in d:
  l[i] += 1
cou = 1
if 0 in l:
  a = l.index(0)
  if sum(l[a:])!=0:
    print(0)
    exit()
for i in range(n-2):
  if l[i+1]!=0:
    a = l[i]
    b = l[i+1]
    cou *= (a**b)%mod
print(cou%mod)
Buggy python submission (verdict: Runtime Error):
a,b =map(int,input().split())
if 1 <= a,b <=9:
		print(a*b)
		
else:
		print(-1)

Fixed submission:
a,b =map(int,input().split())
if 1 <= a <=9 and 1 <= b <=9:
		print(a*b)
		
else:
		print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
A = sorted(list(map(int,input().split())))
F = sorted(list(map(int,input().split())))[::-1]
o = []
for a,f in zip(A,F):
    o.append(a*f)
ok = max(o)    
ng = -1

while ok - ng > 1:
    mid = (ok+ng)//2
    k1 = 0
    for i in range(n):
        k1 += max( 0 , A[i]- mid//F[i])
    if k1<= k:
        ok = mid
    else:
        ng = mid
print(ok)


Fixed submission:
n,k = map(int,input().split())
A = sorted(list(map(int,input().split())))
F = sorted(list(map(int,input().split())))[::-1]
o = []
for a,f in zip(A,F):
    o.append(a*f)
ok = max(o)    
ng = -1

while ok - ng > 1:
    mid = (ok+ng)//2
    k1 = 0
    for i in range(n):
        k1 += max( 0 , A[i]- mid//F[i])
    if k1<= k:
        ok = mid
    else:
        ng = mid
print(ok)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
l = sorted(list(map(int,input().split())))
cou =0
for i in range(0,n-2):
  for j in range(i+1,n-1):
    #iがaの長さ、jがbの長さ
    m = l[i]
    u = l[j]
    l1 = l[j+1:]
    c =bisect.bisect_left(l1,m+u)
    cou += c
print(cou)
    

Fixed submission:
import bisect
n = int(input())
l = sorted(list(map(int,input().split())))
cou =0
for i in range(0,n-2):
  for j in range(i+1,n-1):
    #iがaの長さ、jがbの長さ
    m = l[i]
    u = l[j]
    c =bisect.bisect_left(l,m+u)
    if c>j+1:
      cou += c-j-1
print(cou)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = sorted(list(map(int,input().split())))
cou =0
for i in range(0,n-2):
  for j in range(i+1,n-1):
    #iがaの長さ、jがbの長さ
    m = l[i]
    u = l[j]
    l1 = l[j+1:]
    c =[t for t in l1 if max(m-u,u-m)<t and t<m+u]
    cou += len(c)
print(cou)
    

Fixed submission:
import bisect
n = int(input())
l = sorted(list(map(int,input().split())))
cou =0
for i in range(0,n-2):
  for j in range(i+1,n-1):
    #iがaの長さ、jがbの長さ
    m = l[i]
    u = l[j]
    c =bisect.bisect_left(l,m+u)
    if c>j+1:
      cou += c-j-1
print(cou)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l1 = list(map(int,input().split()))

for i in range(m):
  l1 = sorted(l1)
  l1[-1] //= 2
print(sum(l1))
  

Fixed submission:
a = input()
s = "Sunny"
c = "Cloudy"
r = "Rainy"
 
if a == s:
		print(c)
elif a == c:
		print(r)
		
else:
		print(s)

Buggy python submission (verdict: Runtime Error):
a = input()
s = "Sunny"
c = "Cloudy"
r = "Rainy"

if a == s:
		print(c)
else a == c:
		print(r)
		
else:
		print(s)

Fixed submission:
a = input()
s = "Sunny"
c = "Cloudy"
r = "Rainy"
 
if a == s:
		print(c)
elif a == c:
		print(r)
		
else:
		print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l1 = list(map(int,input().split()))

for i in range(m):
  l1 = sorted(l1)
  l1[-1] //= 2
print(sum(l1))
  

Fixed submission:
import heapq 
n,m = map(int,input().split())
l = list(map(int,input().split()))
l1 = [-i for i in l]
heapq.heapify(l1)

for i in range(m):
  a = heapq.heappop(l1)
  b = -(-a//2)
  heapq.heappush(l1,b)
print(sum(l1)*-1)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
i = 0 
for t in range(3):
		if a(t) == b(t) :
			i += 1
print(i)

Fixed submission:
a = input()
b = input()
i = 0 
for t in range(3):
		if a[t]== b[t] :
			i += 1
print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
c = 0
a = []
for i in range(n-1):
  if h[i]>=h[i+1]:
    c += 1
  else:
    a.append(c)
    c =0
  print(c)
print(max(a))

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
c = 0
a = [0]
for i in range(n-1):
  if h[i]>=h[i+1]:
    c += 1
  else:
    a.append(c)
    c =0
  a.append(c)
print(max(a))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
i = 0
while 2*a+(a-1)*(i-2)  <b:
  i += 1
print(i+1)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
a = 0
for i in range(n):
  a += 1/l[i]
print(1/a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = ([int(input()) for j in range(n)])
a = max(l)
for i in range(n):
  if l[i]==a:
    print(max(l[:i]+l[i+1:]))
  else:
    print(a)

Fixed submission:
n = int(input())
l = ([int(input()) for j in range(n)])
a = sorted(l)[-1]
b = sorted(l)[-2]

for i in range(n):
  if l[i]==a:
    print(b)
  else:
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(input()) for j in range(n)]
for i in range(n):
  a =l[:i]+l[i+1:]
  print(max(a))

Fixed submission:
n = int(input())
l = ([int(input()) for j in range(n)])
a = sorted(l)[-1]
b = sorted(l)[-2]

for i in range(n):
  if l[i]==a:
    print(b)
  else:
    print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
k = [0 for i in range(n)]
t = []
for i in range(n-1,-1,-1):
  a = l[i]
  if a!=k[i]:
    t.append(i+1)
    for j in range(i,-1,-1):
      if (i+1)%(j+1)==0:
        k[j] += 1
        k[j] %= 2
if len(t)==0:
  print(0)
else:
  print(len(t))
  print(*t)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
k = [0 for i in range(n)]
t = []
for i in range(n-1,-1,-1):
  a = l[i]
  s = 0
  for j in range(i,n,i+1):
    if j ==i:
      continue
    if k[j]==1:
      s += 1
      s %= 2
  if a!=(k[i]+s)%2:
    t.append(i+1)
    k[i] += 1
    k[i] %= 2
    
if len(t)==0:
  print(0)
else:
  print(len(t))
  print(*t)
Buggy python submission (verdict: Runtime Error):
n.a.b = map(int,input().split())
print(min(n*a,b))

Fixed submission:
n,a,b = map(int,input().split())
print(min(n*a,b))
Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
a = []
if r-l>=2019:
  print(0)
else:
  for i in range(l,r+1):
    a.append(i%2019)
a.sort()
print((a[0]*a[1])%2019)

Fixed submission:
l,r = map(int,input().split())
m = 2018
if r-l>=2019:
  print(0)
else:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      a = (i*j)%2019
      m = min(a,m)
  print(m)

Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
a = []
if r-l>=2019:
  print(0)
else:
  for i in range(l,r+1):
    a.append(i%2019)
a.sort()
print(a[0]*a[1])

Fixed submission:
l,r = map(int,input().split())
m = 2018
if r-l>=2019:
  print(0)
else:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      a = (i*j)%2019
      m = min(a,m)
  print(m)

Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
a = []
if r-l>=2019:
  print(2)
else:
  for i in range(l,r+1):
    a.append(i%2019)
a.sort()
print(a[0]*a[1])

Fixed submission:
l,r = map(int,input().split())
m = 2018
if r-l>=2019:
  print(0)
else:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      a = (i*j)%2019
      m = min(a,m)
  print(m)

Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
if l%2019<=r%2019:
  print(l%2019*(l+1)%2019)
else:
  a = sorted(list(l%2019,(l+1)%2019,r%2019,(r-1)%2019))
  print(a[0]*a[1])

Fixed submission:
l,r = map(int,input().split())
m = 2018
if r-l>=2019:
  print(0)
else:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      a = (i*j)%2019
      m = min(a,m)
  print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
mod = 10**9 + 7

def comb(n,k):
    nCk = 1
    MOD = 10**9+7

    for i in range(n-k+1, n+1):
        nCk *= i
        nCk %= MOD

    for i in range(1,k+1):
        nCk *= pow(i,MOD-2,MOD)
        nCk %= MOD
    return nCk
  
for i in range(1,k+1):
  a = comb(k-1,i-1)%mod
  b = comb(n-k+1,i)%mod
  print(a*b%mod)

Fixed submission:
n,k = map(int,input().split())
mod = 10**9 + 7

def comb(n,k):
    nCk = 1
    MOD = 10**9+7

    for i in range(n-k+1, n+1):
        nCk *= i
        nCk %= MOD

    for i in range(1,k+1):
        nCk *= pow(i,MOD-2,MOD)
        nCk %= MOD
    return nCk
  
for i in range(1,k+1):
  a = comb(k-1,i-1)%mod
  b = comb(n-k+1,i)%mod
  print(a*b%mod)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
n = len(s)
d = [s[0]]
for i in range(1,n):
  if s[i]=="C" and s[i-1]=='B':
    d.pop()
    d.append("x")
  else:
    d.append(s[i])
q = "".join(d)
cou = 0
while "Ax" in q:
  cou += q.count("Ax")
  q = q.replace("Ax","xA")
#  print(q)
print(cou)

Fixed submission:
s = input()
n = len(s)
d = [s[0]]
for i in range(1,n):
  if s[i]=="C" and s[i-1]=='B':
    d.pop()
    d.append("x")
  else:
    d.append(s[i])
q = "".join(d)
cou = 0
cou_a = 0
l = len(q)
for i in range(l):
  if q[i]=="A":
    cou_a += 1
  elif q[i]=="x":
    cou +=  cou_a
  else:
    cou_a = 0
print(cou)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(n＊180 - 360)

Fixed submission:
n = int(input())
print((n - 2) * 180)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = list(list(map(int,input().split())) for _ in range (m))
p = set(i for i in range(1,n+1))
for i in l:
  s,t = i
  a = set(q for q in range(s,t+1))
  p = p&a
print(len(p))

Fixed submission:
n,m = map(int,input().split())
l = list(list(map(int,input().split())) for _ in range (m))
a = l[0][0]
b = l[0][1]
for s,t in l:
  a = max(a,s)
  b = min(b,t)
print(max(b-a+1,0))
Buggy python submission (verdict: Runtime Error):
a,b = map(in,input().split())
print(a-b+1)

Fixed submission:
a,b = map(int,input().split())
print(a-b+1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input() for _ in range(n))
cou = 0
for i in s:
    cou += i.count('AB')
a = 0
b = 0
both = 0
for i in s:
    if i[0]=="B":
        b += 1
    if i[-1]=="A":
        a += 1
    if i[0]=="B" and i[-1]=="A":
        both += 1
if min(a,b)>=both  :
    print(cou+min(a,b)-1)
else:
    print(cou+min(a,b))

Fixed submission:
a,b = map(int,input().split())
print(a-b+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
from math import gcd
cou = 0
for i in range(1,int(n**0.5)+1):
  if n%i==0:
    b = n//i-1
    if n//b==n%b:
      cou += b
    
    if i>2:
      c = i-1
      if n//c==n%c:
        cou += c
print(cou)

Fixed submission:
n = int(input())
from math import gcd
cou = 0
for i in range(1,int(n**0.5)+1):
  if n%i==0:
    b = n//i-1
    if b>=2 and n//b==n%b:
      cou += b
    
    if i>2:
      c = i-1
      if n//c==n%c:
        cou += c
print(cou)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
cou = 0
if "#" not in s:
  print(0)
else:
  a = s.index("#")
  s_r = s[::-1]
  a1 = s_r.index(".")
  a3 = n-a1
  s1 = s[a:a3]
  b = s1.count(".")
  c = s1.count("#")
  print(min(b,c))

Fixed submission:
from itertools import accumulate
n = int(input())
s = input()
l = []
for i in s:
  if i==".":
    l.append(0)
  else:
    l.append(1)
l1 = list(accumulate([0]+l))
#print(l1)
l = []
for i in s[::-1]:
  if i==".":
    l.append(1)
  else:
    l.append(0)
l2 = list(accumulate([0]+l))[::-1]
#print(l2)
cou = 10**6
if "#" not in s or "." not in s :
  print(0)
else:
  #左が"."　右が"#"  左は#の個数調べて右は.の個数調べる
  for j,k in zip(l1,l2):
    a = j+k
    cou = min(cou,a)
  print(cou)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(int(input()) for i in range(n))
a = -(-n//min(l))+4
print(a)

Fixed submission:
n = int(input())
l = list(int(input()) for i in range(5))
a = -(-n//min(l))+4
print(a)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]

for i in range(N-1):
  a = set(l[i])&set(l[i+1])
  l[i+1] = a
print(len(a))

Fixed submission:
A,B = map(int,input().split())
if B%A == 0 :
  print(A+B)

else:
  print(B-A)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]
if N!=1:
  for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
    print(len(a))
else:


Fixed submission:
N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]

for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
if N==1:
  print(len(l[0])) 
else:
  print(len(a))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]

for i in range(N-1):
  a = set(l[i])&set(l[i+1])
  l[i+1] = a
print(len(a))

Fixed submission:
N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]

for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
if N==1:
  print(len(l[0])) 
else:
  print(len(a))
Buggy python submission (verdict: Runtime Error):
k,a,b = map(int,input().split())
if a+2>=b:
  print(1+k)
else:
  #bisできるセット
  q = (k-a+1)//2
  if q ==0:
    print(i+k)
  else:
    print(1+(k-2*q)+q*(b-a))

Fixed submission:
k,a,b = map(int,input().split())
if a+2>=b:
  print(1+k)
else:
  #bisできるセット
  q = (k-a+1)//2
  if q ==0:
    print(1+k)
  else:
    print(1+(k-2*q)+q*(b-a))
Buggy python submission (verdict: Time Limit Exceeded):
n,k  = map(int,input().split())
a = list(map(int,input().split()))
INF = 10**15
dp = [INF for _ in range(n)]
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j <= n-1 :
            dp[i+j] = min(dp[i]+ abs(a[i+j] - a[i]) , dp[i+j])
print(dp[-1])


Fixed submission:
n,k  = map(int,input().split())
a = list(map(int,input().split()))
INF = 10**15
dp = [INF for _ in range(n)]
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j <= n-1 :
            dp[i+j] = min(dp[i]+ abs(a[i+j] - a[i]) , dp[i+j])
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,W = map(int,input().split())
w = []
v = []
for i in range(N):
    x,y = map(int,input().split())
    w.append(x)
    v.append(y)

dp = [[0]*(W+1) for j in range(N+1)] # DPテーブルの作成

for i in range(N):
    for j in range(W+1):
        if j < w[i]: # 選ばない時
            dp[i+1][j] = dp[i][j]
        else: # 選ぶ時
            dp[i+1][j] = max(dp[i][j],dp[i][j-w[i]]+v[i])

print(dp[N][W])

Fixed submission:
N,W = map(int,input().split())
w = []
v = []
for i in range(N):
    x,y = map(int,input().split())
    w.append(x)
    v.append(y)

dp = [[0]*(W+1) for j in range(N+1)] # DPテーブルの作成

for i in range(N):
    for j in range(W+1):
        if j < w[i]: # 選ばない時
            dp[i+1][j] = dp[i][j]
        else: # 選ぶ時
            dp[i+1][j] = max(dp[i][j],dp[i][j-w[i]]+v[i])

print(dp[N][W])
Buggy python submission (verdict: Time Limit Exceeded):


s = input()
l_s = len(s)
t = input()
l_t = len(t)

dp = list([0 for _ in range(l_t+1)] for _ in range(l_s+1))

for i in range(l_s):
    for j in range(l_t):
        #dp[i+1][j+1]  = ...
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i][j]+1 , dp[i+1][j] , dp[i][j+1])
        else:
            dp[i+1][j+1] = max(dp[i][j], dp[i+1][j] , dp[i][j+1])

ans = []
l = dp[-1][-1]
i = l_s
j = l_t
while l != 0:
    if s[i-1] == t[j-1]:
        ans.append(s[i-1])
        i -= 1
        j -= 1
        l -= 1
    elif dp[i][j] == dp[i-1][j]:
        i -= 1
    else:
        j -= 1

print("".join(ans[::-1]))




Fixed submission:


s = input()
l_s = len(s)
t = input()
l_t = len(t)

dp = list([0 for _ in range(l_t+1)] for _ in range(l_s+1))

for i in range(l_s):
    for j in range(l_t):
        #dp[i+1][j+1]  = ...
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i][j]+1 , dp[i+1][j] , dp[i][j+1])
        else:
            dp[i+1][j+1] = max(dp[i][j], dp[i+1][j] , dp[i][j+1])

ans = []
l = dp[-1][-1]
i = l_s
j = l_t
while l != 0:
    if s[i-1] == t[j-1]:
        ans.append(s[i-1])
        i -= 1
        j -= 1
        l -= 1
    elif dp[i][j] == dp[i-1][j]:
        i -= 1
    else:
        j -= 1

print("".join(ans[::-1]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
l =[]
for i in range(n):
  a = T - h[i]*0.006
  b = int(abs(a-A))
  l.append(b)
c = l.index(min(l))
print(c+1)

Fixed submission:
D = int(input())
if D == 22:
  print("Christmas Eve Eve Eve")
  
elif D == 23:
  print("Christmas Eve Eve")
  
elif D == 24:
  print("Christmas Eve")
  
elif D == 25:
  print("Christmas")

Buggy python submission (verdict: Runtime Error):
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
l =[]
for i in range(n):
  a = T - h[i]*0.006
  b = int(abs(a-A))
  l.append(b)
c = l.index(min(l))
print(c+1)

Fixed submission:
D = int(input())
if D == 22:
  print("Christmas Eve Eve Eve")
  
elif D == 23:
  print("Christmas Eve Eve")
  
elif D == 24:
  print("Christmas Eve")
  
elif D == 25:
  print("Christmas")

Buggy python submission (verdict: Runtime Error):
D = int(input())
if D =22:
  print("Christmas Eve Eve Eve")
  
elif D = 23:
  print("Christmas Eve Eve")
  
elif D = 24:
  print("Christmas Eve")
  
elif D = 25:
  print("Christmas")

Fixed submission:
D = int(input())
if D == 22:
  print("Christmas Eve Eve Eve")
  
elif D == 23:
  print("Christmas Eve Eve")
  
elif D == 24:
  print("Christmas Eve")
  
elif D == 25:
  print("Christmas")
Buggy python submission (verdict: Runtime Error):
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
#print(h)
l =[]
for i in range(n):
  a = T - h[i]*0.006
 # print(a)
  b = abs(a-A)
  l.append(b)
  #print(l)
c = h.index(h[l.index(min(l))])
print(c+1)

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

print(int(x+y/2))

Buggy python submission (verdict: Runtime Error):
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
#print(h)
l =[]
for i in range(n):
  a = T - h[i]*0.006
  print(a)
  b = abs(a-A)
  l.append(b)
  print(l)
c = h.index(h[l.index(min(l))])
print(c+1)

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

print(int(x+y/2))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = [list(map(int,input().split())) for _ in range(m)]
#print(l)
k = [[] for i in range(n)]
for j,h in l:
  k[j-1].append(h)
k_so = [[] for i in range(n)]
for i in range(n):
  a = k[i]
  k_so[i] = sorted(a)
#print(k_so)
for j,h in l:
  first = "{:0=6}".format(j)
  second = "{:0=6}".format(k_so[j-1].index(h)+1)
  print(first+second)

Fixed submission:
from bisect import bisect_left 
n,m = map(int,input().split())
l = [list(map(int,input().split())) for _ in range(m)]
#print(l)
k = [[] for i in range(n)]
for j,h in l:
  k[j-1].append(h)
k_so = [[] for i in range(n)]
for i in range(n):
  a = k[i]
  k_so[i] = sorted(a)
#print(k_so)
for j,h in l:
  first = "{:0=6}".format(j)
  t = bisect_left(k_so[j-1], h)
  second = "{:0=6}".format(t+1)
  print(first+second)
Buggy python submission (verdict: Runtime Error):
from  fractions  import gcd
n,m = map(int,input().split())
s = input()
t = input()
def lcm(x,y):
  return (x*y)//gcd(x,y)

a = lcm(n,m)
b = gcd(n,m)
if b==1:
  if s[0]==t[1]:
    print(a)
  else:
    print(-1)
k = int(a//b)
for i in range(b):
  w = int(n*i//b)
  ww = int(m*i//b)
  if s[w]==t[ww]:
    continue
  else:
    print(-1)
else:
  print(a)

Fixed submission:
from  fractions  import gcd
n,m = map(int,input().split())
s = input()
t = input()
def lcm(x,y):
  return (x*y)//gcd(x,y)

a = lcm(n,m)
b = gcd(n,m)
if b==1:
  if s[0]==t[0]:
    print(a)
  else:
    print(-1)
else:
  k = int(a//b)
  for i in range(b):
    w = int(n*i//b)
    ww = int(m*i//b)
    if s[w]==t[ww]:
      continue
    else:
      print(-1)
      exit()
  else:
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from  fractions  import gcd
n,m = map(int,input().split())
s = input()
t = input()
def lcm(x,y):
  return (x*y)//gcd(x,y)

a = lcm(n,m)
l = [0 for i in range(a)]
l1 = [0 for i in range(a)]
for i in range(n):
  l[int(i*(a/n))+1-1] = s[i]
for j in range(m):
  l1[int(j*(a/m))+1-1] = t[j]
for j,k in zip(l,l1):
  if j!=k and j!=0 and k!=0:
    print("-1")
    exit()
else:
  print(a)

Fixed submission:
from  fractions  import gcd
n,m = map(int,input().split())
s = input()
t = input()
def lcm(x,y):
  return (x*y)//gcd(x,y)

a = lcm(n,m)
b = gcd(n,m)
if b==1:
  if s[0]==t[0]:
    print(a)
  else:
    print(-1)
else:
  k = int(a//b)
  for i in range(b):
    w = int(n*i//b)
    ww = int(m*i//b)
    if s[w]==t[ww]:
      continue
    else:
      print(-1)
      exit()
  else:
    print(a)
Buggy python submission (verdict: Runtime Error):
N,T = map(int,input().split())
l = [list(map(int,input().split())) for i in range(N)]
##print(l)
a = []
for i in range(N):
  if l[i][1] < T:
    a.append(l[i][0])
t = min(a)
print(t)

Fixed submission:
N,T = map(int,input().split())
l = [list(map(int,input().split())) for i in range(N)]
##print(l)
a = []
for i in range(N):
  if l[i][1] <= T:
    a.append(l[i][0])
if a != []:
  t = min(a) 
  print(t)
else:
  print("TLE")

Buggy python submission (verdict: Runtime Error):
N,T = map(int,input().split())
l = [list(map(int,input().split())) for i in range(N)]
#print(l)
a = []
for i in range(N):
  if l[0][i] < T:
    a.append(l[0][i])
t = min(a)
print(t)

Fixed submission:
N,T = map(int,input().split())
l = [list(map(int,input().split())) for i in range(N)]
##print(l)
a = []
for i in range(N):
  if l[i][1] <= T:
    a.append(l[i][0])
if a != []:
  t = min(a) 
  print(t)
else:
  print("TLE")