Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
H,W=[int(s) for s in input().split()]
cam_ls=[ "." for _ in range(H+2)]
for j in range(H+1):
  cam_ls[0]=cam_ls[0]+"."
  cam_ls[H+1]=cam_ls[H+1]+"."
for i in range(1,H+1):
  cam_ls[i]=cam_ls[i]+input()+"."
  
def pos(h,w):
  if cam_ls[h][w]==".":
    return 1
  elif (cam_ls[h+1][w]=="." and
        cam_ls[h-1][w]=="." and
        cam_ls[h][w+1]=="." and
        cam_ls[h][w-1]=="."):
    return 0
  else:
    return 1

ans=1
for i in range(1,H+1):
  for j in range(1,W+1):
    ans*=pos(i,j)
if ans==1:
  print("Yes")
else:
  print("No")



Fixed submission:
H,W=[int(s) for s in input().split()]
cam_ls=[ "." for _ in range(H+2)]
for j in range(W+1):
  cam_ls[0]=cam_ls[0]+"."
  cam_ls[H+1]=cam_ls[H+1]+"."
for i in range(1,H+1):
  cam_ls[i]=cam_ls[i]+input()+"."
  
def pos(h,w):
  if cam_ls[h][w]==".":
    return 1
  elif (cam_ls[h+1][w]=="." and
        cam_ls[h-1][w]=="." and
        cam_ls[h][w+1]=="." and
        cam_ls[h][w-1]=="."):
    return 0
  else:
    return 1

ans=1
for i in range(1,H+1):
  for j in range(1,W+1):
    ans*=pos(i,j)
if ans==1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c,x,y=[int(s) for s in input().split()]
if x<=y:
  A=a
  B=b
  C=c
  X=x
  Y=y
else:
  A=b
  B=a
  C=c
  X=y
  Y=x
print(min[Y*2*C,X*2*C+(Y-X)*B,X*A+(Y-X)*B])

Fixed submission:
a,b,c,x,y=[int(s) for s in input().split()]
if x<=y:
  A=a
  B=b
  C=c
  X=x
  Y=y
else:
  A=b
  B=a
  C=c
  X=y
  Y=x
#print([Y*2*C,X*2*C+(Y-X)*B,X*A+Y*B])
print(min([Y*2*C,X*2*C+(Y-X)*B,X*A+Y*B]))
Buggy python submission (verdict: Runtime Error):
x=list(input())
x.sort()
if x==[a,b,c]:
  print("Yes")
else:
  print("No")

Fixed submission:
x=list(input())
x.sort()
if x==["a","b","c"]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c,d=[int(s) for s in input().split()]
print(min([a+c,a+d,b+c,c+d]))

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min([a+c,a+d,b+c,b+d]))
Buggy python submission (verdict: Runtime Error):
dicN={}
for i in range(int(input())):
  x=input()
  if x in dicN:
    dicN[x]+=1
  else:
    dicN[x]=1
dicM={}
for i in range(int(input())):
  x=input()
  if x in dicM:
    dicM[x]+=1
  else:
    dicM[x]=1
print(max([dicN[e]-dicM[e] for e in dicN.keys()]+[0]))

Fixed submission:
dicN={}
for i in range(int(input())):
  x=input()
  if x in dicN:
    dicN[x]+=1
  else:
    dicN[x]=1
dicM={}
for i in range(int(input())):
  x=input()
  if x in dicM:
    dicM[x]+=1
  else:
    dicM[x]=1
ls=[0]
for k,v in dicN.items():
  if k in dicM:
    ls.append(v-dicM[k])
  else:
    ls.append(v)
print(max(ls))
Buggy python submission (verdict: Runtime Error):
def palindromeQ(num):
  if num%10==num//10000:
    if (num%100)//10==(num//1000)%10:
      return(1)
    else:
      return(0)
  else:
    return(0)
ans=0
for i in range(A,B+1):
  ans+=palindromeQ(i)
print(ans)
  

Fixed submission:
def palindromeQ(num):
  if num%10==num//10000:
    if (num%100)//10==(num//1000)%10:
      return(1)
    else:
      return(0)
  else:
    return(0)
ans=0
A,B=[int(s) for s in input().split()]
for i in range(A,B+1):
  ans+=palindromeQ(i)
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(N):
  x=int(input())
  if x=="Y":
    print("Four")
    break
else:
  print("Three")
  

Fixed submission:
N=int(input())
ls=input().split()
for i in range(N):
  x=ls[i]
  if x=="Y":
    print("Four")
    break
else:
  print("Three")
Buggy python submission (verdict: Runtime Error):
a,b=[int(s) for s in input().split()]
if (a*b)%2==1:
  Print("Odd")
else:
  Print("Even")

Fixed submission:
a,b=[int(s) for s in input().split()]
if (a*b)%2==0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
S,T=input().split()
x=int(S+T)
if int(math.sqrt(x))**2==x:
  print('Yes')
else:
  print('No')


Fixed submission:
import math
S,T=input().split()
x=int(S+T)
if int(math.sqrt(x))**2==x:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,Y=[int(s) for s in input().split()]
##N枚でY円
flag=0
i10=0
while i10*10000<=Y and i10<=N:
  i5=0
  while i10*10000+i5*5000<=Y and i10+i5<=N :
    i1=(Y%5000)//1000
    while i10*10000+i5*5000+i1*1000<=Y and i10+i5+i1<=N :
      if i10*10000+i5*5000+i1*1000==Y and i10+i5+i1==N:
        print(*[i10,i5,i1])
        flag=1
        break
      i1+=5
    if flag==1 : break
    i5+=1
  if flag==1 : break
  i10+=1
else:
  print(*[-1,-1,-1])


Fixed submission:
N,Y=[int(s) for s in input().split()]
##N枚でY円
flag=0
i10=0
while i10*10000<=Y and i10<=N:
  i5=0
  while i10*10000+i5*5000<=Y and i10+i5<=N :
    i1=N-i10-i5
    if i10*10000+i5*5000+i1*1000==Y:
      print(*[i10,i5,i1])
      flag=1
      break
    i5+=1
  if flag==1 : break
  i10+=1
else:
  print(*[-1,-1,-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Y=[int(s) for s in input().split()]
##N枚でY円
flag=0
i10=0
while i10*10000<=Y and i10<=N:
  i5=0
  while i10*10000+i5*5000<=Y and i10+i5<=N :
    i1=0
    while i10*10000+i5*5000+i1*1000<=Y and i10+i5+i1<=N :
      if i10*10000+i5*5000+i1*1000==Y and i10+i5+i1==N:
        print(*[i10,i5,i1])
        flag=1
        break
      i1+=1
    if flag==1 : break
    i5+=1
  if flag==1 : break
  i10+=1
else:
  print(*[-1,-1,-1])


Fixed submission:
N,Y=[int(s) for s in input().split()]
##N枚でY円
flag=0
i10=0
while i10*10000<=Y and i10<=N:
  i5=0
  while i10*10000+i5*5000<=Y and i10+i5<=N :
    i1=N-i10-i5
    if i10*10000+i5*5000+i1*1000==Y:
      print(*[i10,i5,i1])
      flag=1
      break
    i5+=1
  if flag==1 : break
  i10+=1
else:
  print(*[-1,-1,-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Y=[int(s) for s in input().split()]
##N枚でY円
flag=0
i10=0
while i10*10000<=Y:
  i5=0
  while i10*10000+i5*5000<=Y:
    i1=0
    while i10*10000+i5*5000+i1*1000<=Y:
      if i10*10000+i5*5000+i1*1000==Y and i10+i5+i1==N:
        print(*[i10,i5,i1])
        flag=1
        break
      i1+=1
    if flag==1 : break
    i5+=1
  if flag==1 : break
  i10+=1
else:
  print(*[-1,-1,-1])


Fixed submission:
N,Y=[int(s) for s in input().split()]
##N枚でY円
flag=0
i10=0
while i10*10000<=Y and i10<=N:
  i5=0
  while i10*10000+i5*5000<=Y and i10+i5<=N :
    i1=N-i10-i5
    if i10*10000+i5*5000+i1*1000==Y:
      print(*[i10,i5,i1])
      flag=1
      break
    i5+=1
  if flag==1 : break
  i10+=1
else:
  print(*[-1,-1,-1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
ls=[int(s) for s in input().split()]
count=0
i=0
while(True):
  if ls[i]%2==1:
    break
  ls[i]=ls[i]//2
  if i<N:
    i+=1
  else:
    count+=1
    i=0    
print(count)


Fixed submission:
N=int(input())
ls=[int(s) for s in input().split()]
count=-1
flag=1
while(flag==1):
  count+=1
  for i in range(N):
    if ls[i]%2==1:
      flag=0
      break
    ls[i]=ls[i]//2
print(count)
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=[0 for _ in range(N+1)]
L[0]=2
L[1]=1
for i in range(2,N+1):
  L[i]=L[i-1]+L[i-2]
print(L[N+1])

Fixed submission:
N=int(input())
L=[0 for _ in range(N+1)]
L[0]=2
L[1]=1
for i in range(2,N+1):
  L[i]=L[i-1]+L[i-2]
print(L[N])
Buggy python submission (verdict: Runtime Error):
import math
x=int(input())
print(int(math.sqrt(x))**2)


Fixed submission:
S=input()
T=input()
if [S[0],S[1],S[2]]==[T[2],T[1],T[0]]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
x,a,b=[int(s) for s in input().split()]
if abs(a-x)<abs(b-x):
  print('A'):
else:
  print('B')

Fixed submission:
x,a,b=[int(s) for s in input().split()]
if abs(a-x)<abs(b-x):
  print('A')
else:
  print('B')
Buggy python submission (verdict: Time Limit Exceeded):
def culcSum(n:int)->int:
    ans = n * culcDivisor(n)
    #print(ans)
    return ans

def culcDivisor(n:int)->int:
    cnt = 0
    for idx in range(1, n+1):
        if n % idx == 0:
            cnt += 1

    return cnt

n :int = int(input())
ans = 0
for idx in range(1, n+1):
    ans += culcSum(idx)

print(ans)


Fixed submission:
n = int(input())
s = 0
for i in range(1, n + 1):
  d = n // i
  s += d * (d + 1) // 2 * i
print(s)
Buggy python submission (verdict: Runtime Error):
lengthNum, countNum, sumNum = map(int, input().split())

aryAns = []
tmp = lengthNum - countNum
tNum = 2 if sumNum == 1 else sumNum-1
aryAns = [sumNum]*countNum + [sumNum-1]*tmp

print(" ".join([str(x) for x in aryAns]))


Fixed submission:
def countChange(inputNum, divNum):
    tmp = inputNum // divNum
    if inputNum % divNum != 0:
        tmp += 1

    return tmp

height = int(input())
width = int(input())
goal = int(input())

if height > width:
    divNum = height
else:
    divNum = width

ans = countChange(goal, divNum)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ar = list(map, input().split())

count = 0
for i in range(N):
    if ar[i] >= K:
        count += 1

print(count)


Fixed submission:
N, K = map(int, input().split())
ar = list(map(int, input().split()))

count = 0
for i in range(N):
    if ar[i] >= K:
        count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ar = list(map, input().split())

count = 0
for n in ar:
    if n >= K:
        count += 1

print(count)


Fixed submission:
N, K = map(int, input().split())
ar = list(map(int, input().split()))

count = 0
for i in range(N):
    if ar[i] >= K:
        count += 1

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

ansAr = []
for i in range(N):
    ansAr.append(ar.index(i+1)+1)

print(" ".join([str(n) for n in ansAr]))

Fixed submission:
N = int(input())
ar = list(map(int, input().split()))
dic = {}
for i in range(len(ar)):
    dic[i] = ar[i]

arFast = sorted(dic.items(), key=lambda x: x[1], reverse=False)
for n in arFast:
    print(n[0]+1, end=" ")

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

arFast = sorted(ar, key=lambda x: x[1], reverse=True)
print(arFast)

Fixed submission:
N = int(input())
ar = list(map(int, input().split()))
dic = {}
for i in range(len(ar)):
    dic[i] = ar[i]

arFast = sorted(dic.items(), key=lambda x: x[1], reverse=False)
for n in arFast:
    print(n[0]+1, end=" ")
Buggy python submission (verdict: Runtime Error):
n = int(input())

intCount = 0

for idx in range(1, n+1):
    if len(str(idx) % 2 == 1:
        intCount += 1

print(intCount)

Fixed submission:
n = int(input())

if n < 10:  # < 10^1
    # 1-n
    print(n)

elif n < 100:  # < 10^2
    # 1-9
    print(9)

elif n < 1000:  # < 10^3
    # 1-9, 100-n
    print(n-99+9)

elif n < 10000:  # < 10^4
    # 1-9, 100-999
    print(9+900)

elif n < 100000:  # < 10^5
    # 1-9 + 100-999 + 10000-n
    print(n-9999+900+9)

else:  # == 10^5
    # 1-9 + 100-999 + 10000-90000
    print(9+900+90000)

Buggy python submission (verdict: Runtime Error):
intCount = 0

for idx in range(1, n+1):
    if len(str(idx) % 2 == 1:
        intCount += 1

print(intCount)

Fixed submission:
n = int(input())

if n < 10:  # < 10^1
    # 1-n
    print(n)

elif n < 100:  # < 10^2
    # 1-9
    print(9)

elif n < 1000:  # < 10^3
    # 1-9, 100-n
    print(n-99+9)

elif n < 10000:  # < 10^4
    # 1-9, 100-999
    print(9+900)

elif n < 100000:  # < 10^5
    # 1-9 + 100-999 + 10000-n
    print(n-9999+900+9)

else:  # == 10^5
    # 1-9 + 100-999 + 10000-90000
    print(9+900+90000)
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = []

z=False
for x in input().split(' '):
    if x == 0:
        z = True
    arr.append(x)
if z == True:
    print(0)

else:
    ans = 1
    for x in arr:
        ans *= x
        if ans > int(1e18):
            print(-1)
    else:
        print(ans)

Fixed submission:
n = int(input())
arr = []

z=False
for x in input().split(' '):
    if x == '0':
        z = True
    arr.append(int(x))
if z == True:
    print(0)

else:
    ans = 1
    for x in arr:
        ans *= x
        if ans > int(1e18):
            print(-1)
            exit(0)
    
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
arr = [int(x) for x in input().split(' ')]

ans = 1
for x in arr:
    ans *= x
    
if ans > int(1e18):
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
arr = []

z=False
for x in input().split(' '):
    if x == '0':
        z = True
    arr.append(int(x))
if z == True:
    print(0)

else:
    ans = 1
    for x in arr:
        ans *= x
        if ans > int(1e18):
            print(-1)
            exit(0)
    
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

def make_div(n):
    div = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div.append(i)
            if i != n // i:# 平方数の時を考慮
                div.append(n//i)

    div.sort()
    return div

ans=0
for i in range(1,n):
    ans+=len(make_div(i))
print(ans)

Fixed submission:
n=int(input())

ans=0
for i in range(1,n):
    ans+=(n-1)//i
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
import sympy
ans=0
for i in range(1,n):
    ans+=len(sympy.divisors(i))
print(ans)

Fixed submission:
n=int(input())

ans=0
for i in range(1,n):
    ans+=(n-1)//i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=input()
list1=list(map(int,input().split()))
if 0 in list1:
    print(0)
else:
    ans=1
    for i in list1:
        ans*=i
    print(ans) if ans<=1e18 else print(-1)

Fixed submission:
n=input()
list1=list(map(int,input().split()))
if 0 in list1:
    print(0)
else:
    ans=1
    for i in list1:
        ans*=i
        if ans>1e18:
            ans=-1
            break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=input()
list1=list(map(int,input().split()))
if 0 in list1:
    print(0)
else:
    ans=1
    for i in list1:
        ans*=i
    print(ans) if ans<=1e18 else print(-1)


Fixed submission:
n=input()
list1=list(map(int,input().split()))
if 0 in list1:
    print(0)
else:
    ans=1
    for i in list1:
        ans*=i
        if ans>1e18:
            ans=-1
            break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=input()
list1=map(int,input().split())
ans = 1
for i in list1:
    ans*=i
    if ans>1e18:
        ans=-1
print(ans)

Fixed submission:
n=input()
list1=list(map(int,input().split()))
if 0 in list1:
    print(0)
else:
    ans=1
    for i in list1:
        ans*=i
        if ans>1e18:
            ans=-1
            break
    print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
a = int(a)
b = int(b.repalce('.',""))

print(int(a*b)//100)

Fixed submission:
a,b=input().split()
a = int(a)
b = int(b.replace('.',""))

print(int(a*b)//100)

Buggy python submission (verdict: Runtime Error):
a,b = map(double,input().split())
print(int(a*b))

Fixed submission:
a,b=input().split()
a = int(a)
b = int(b.replace('.',""))

print(int(a*b)//100)
Buggy python submission (verdict: Time Limit Exceeded):
n,m,k=map(int,input().split())

mod=998244353

dp=[[0]*(k+1) for _ in range(n+1)]
dp[1][0]=m

for i in range(2,n+1):
    for j in range(k+1):
        dp[i][j]=((dp[i-1][j]*(m-1))%mod + dp[i-1][j-1]*(j!=0))%mod

ans=0
for j in range(k+1):
    ans+=dp[-1][j]
    ans%=mod
print(ans)

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

mod=998244353

# 階乗計算
fact=[0]*(1+n)
fact[0]=1
for i in range(1,n+1):
    fact[i]=fact[i-1]*i % mod
    
# 階乗の逆元計算
invfact=[0]*(1+n)
invfact[-1]=pow(fact[-1],mod-2,mod) # 逆元を計算するのは最後の要素だけでよくてあとは、前に戻りながらかけていく。
for i in range(n-1,-1,-1):
    invfact[i]=invfact[i+1]*(i+1) % mod
    

# 二項係数のリスト化
def cmb(n,r,mod):
    if r<0 or n<r:
        return 0
    return fact[n] * invfact[r] * invfact[n-r] % mod
    
ans=0
for i in range(k+1):
    ans+=(cmb(n-1,i,mod)*m*pow(m-1,n-i-1,mod))%mod
    ans%mod
print(ans%mod)
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
import math
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            a=math.gcd(i,j)
            ans+=math.gcd(a,l)
print(ans)

Fixed submission:
k=int(input())
import math
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        a=math.gcd(i,j)
        for l in range(1,k+1):
            ans+=math.gcd(a,l)
print(ans)

Buggy python submission (verdict: Runtime Error):
k=int(input())
import math
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
          	a=math.gcd(i,j)
            ans+=math.gcd(a,l)
print(ans)

Fixed submission:
k=int(input())
import math
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        a=math.gcd(i,j)
        for l in range(1,k+1):
            ans+=math.gcd(a,l)
print(ans)

Buggy python submission (verdict: Runtime Error):
k=int(input())
import math
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
          	a=math.gcd(i,j)
            ans+=math.gcd(a,l)
print(ans)

Fixed submission:
k=int(input())
import math
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        a=math.gcd(i,j)
        for l in range(1,k+1):
            ans+=math.gcd(a,l)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=list(input())
from collections import Counter
myc= Counter(s)
val=list(myc.values())
if len(val)!=3:
    print(0)
else:
    ans=val[0]*val[1]*val[2]
    for i in range(n-2):
        for j in range(i+1,n-1):
            if 2*j-i < n:
                if len(set(list((s[i],s[j],s[2*j-i]))))==3:
                    ans-=1
    print(ans)

Fixed submission:
n=int(input())
s=list(input())
from collections import Counter
myc= Counter(s)
val=list(myc.values())
if len(val)!=3:
    print(0)
else:
    ans=val[0]*val[1]*val[2]
    for i in range(n-2):
        for j in range(i+1,n-1):
            if 2*j-i < n:
                if len(set(list((s[i],s[j],s[2*j-i]))))==3:
                    ans-=1
    print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
from collections import Counter
myc= Counter(s)
val=list(myc.values())
ans=val[0]*val[1]*val[2]
for i in range(n-2):
    for j in range(i+1,n-1):
        if 2*j-i < n:
            if len(set(list((s[i],s[j],s[2*j-i]))))==3:
                ans-=1
print(ans)

Fixed submission:
n=int(input())
s=list(input())
from collections import Counter
myc= Counter(s)
val=list(myc.values())
if len(val)!=3:
    print(0)
else:
    ans=val[0]*val[1]*val[2]
    for i in range(n-2):
        for j in range(i+1,n-1):
            if 2*j-i < n:
                if len(set(list((s[i],s[j],s[2*j-i]))))==3:
                    ans-=1
    print(ans)
Buggy python submission (verdict: Runtime Error):
k=int(input())
dp=[[0]*10 for _ in range(5)]
dp[0]=[1]*10
for i in range(4):
    dp[i+1][0]=dp[i][0]+dp[i][1]
    for j in range(1,9):
        dp[i+1][j]=dp[i][j-1]+dp[i][j]+dp[i][j+1]
    dp[i+1][9]=dp[i][8]+dp[i][9]

a=0
h=0
s=0
for i in range(5):
    for j in range(1,10):
        a+=dp[i][j]
        if a>=k:
            a-=dp[i][j]
            s=k-a
            h=j
            d=i
            break
        else:
            continue
    if h!=0:
        break
ans=str(h)
q=0
w=0
for p in range(d):
    for j in range(max(0,h-1),min(h+2,10)):
        q+=dp[p][j]
        if q>=s:
            q-=dp[p][j]
            s=s-a
            ans+=str(j)

            q=0
        elif q==s:
            ans+=str(j)
            w=1
            break
            
        if s==0:
            w=1
            break
    if w==1:
        break
print(int(ans))

Fixed submission:
k=int(input())
lun=[1,2,3,4,5,6,7,8,9]
for i in range(10**5+1):
    if len(lun)>=k:
        break
    di=lun[i]%10
    for j in range(max(0,di-1),min(9,di+1)+1):
        lun.append(lun[i]*10+j)
print(lun[k-1])

Buggy python submission (verdict: Runtime Error):
k=int(input())
dp=[[0]*10 for _ in range(5)]
dp[0]=[1]*10
for i in range(4):
    dp[i+1][0]=dp[i][0]+dp[i][1]
    for j in range(1,9):
        dp[i+1][j]=dp[i][j-1]+dp[i][j]+dp[i][j+1]
    dp[i+1][9]=dp[i][8]+dp[i][9]

a=0
h=0
s=0
for i in range(5):
    for j in range(1,10):
        a+=dp[i][j]
        if a>=k:
            a-=dp[i][j]
            s=k-a
            h=j
            d=i
            break
        else:
            continue
    if h!=0:
        break
ans=str(h)
q=0
w=0
for p in range(d):
    for j in range(max(0,h-1),min(h+2,10)):
        q+=dp[p][j]
        if q>s:
            q-=dp[p][j]
            s=s-a
            ans+=str(j)

            q=0
        elif q==s:
            ans+=str(j)
            w=1
            break
            
        if s==0:
            w=1
            break
    if w==1:
        break
print(int(ans))

Fixed submission:
k=int(input())
lun=[1,2,3,4,5,6,7,8,9]
for i in range(10**5+1):
    if len(lun)>=k:
        break
    di=lun[i]%10
    for j in range(max(0,di-1),min(9,di+1)+1):
        lun.append(lun[i]*10+j)
print(lun[k-1])
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

x,y,a,b,c=map(int, input().split())
pi=list(map(int,input().split()))
qi=list(map(int,input().split()))
ri=list(map(int,input().split()))
pi.sort(reverse=True)
qi.sort(reverse=True)
ri.sort(reverse=True)
ri=deque(ri)

apple=pi[:x]+qi[:y]
apple.sort(reverse=True)
apple=deque(apple)
while min(apple) <= ri[0]:
    c=ri.popleft()
    apple[-1]=c
    if len(ri)==0:
        break
print(sum(apple))

Fixed submission:
from collections import deque
x,y,a,b,c=map(int, input().split())
pi=list(map(int,input().split()))
qi=list(map(int,input().split()))
ri=list(map(int,input().split()))
pi.sort(reverse=True)
qi.sort(reverse=True)

apple=pi[:x]+qi[:y]+ri
apple.sort(reverse=True)

print(sum(apple[:x+y]))
Buggy python submission (verdict: Runtime Error):
l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[int(input())])

Fixed submission:
l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[int(input())-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
xl=list(map(int,input().split()))
ans=[]
for p in range(xl[-1]-xl[0]+1):
    sum1=0
    for xi in xl:
        sum1+=(xi-xl[0]-p)**2
    ans.append(sum1)
print(min(ans))

Fixed submission:
n=int(input())
xl=list(map(int,input().split()))
xl.sort()
ans=[]
for p in range(xl[-1]-xl[0]+1):
    sum1=0
    for xi in xl:
        sum1+=(xi-xl[0]-p)**2
    ans.append(sum1)
print(min(ans))

Buggy python submission (verdict: Runtime Error):
n=int(input())
xl=list(map(int,input().split()))
ans=[]
for i in range(xl[-1]-xl[0]+1):
    sum1=0
    for xi in xl:
        sum1+=(xi-xl[0]-i)**2
    ans.append(sum1)
print(ans)
print(min(ans))

Fixed submission:
n=int(input())
xl=list(map(int,input().split()))
xl.sort()
ans=[]
for p in range(xl[-1]-xl[0]+1):
    sum1=0
    for xi in xl:
        sum1+=(xi-xl[0]-p)**2
    ans.append(sum1)
print(min(ans))
Buggy python submission (verdict: Runtime Error):
n=int(input())
al=list(map(int,input().split())
if len(al)==len(set(al)):
    print('YES')
else:
    print('NO')

Fixed submission:
n=int(input())
al=list(map(int,input().split()))
if len(al)==len(list(set(al))):
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
n=int(input())
al=list(map(int,input().split())
if al==set(al):
    print('YES')
else:
    print('NO')

Fixed submission:
n=int(input())
al=list(map(int,input().split()))
if len(al)==len(list(set(al))):
    print('YES')
else:
    print('NO')