Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())
hwl = []
for _ in range(h):
  l = list(input())
  hwl.append(l)
  
for i in range(h):
  for j in range(w):
    if hwl[i][j] == ".":
      cnt = 0
      if i != 0 and j !=0 and hwl[i-1][j-1] == "#":
        cnt +=1
      
      if i != 0 and hwl[i-1][j] == "#":
        cnt +=1
      
      if i != 0 and hwl[i-1][j+1] == "#":
        cnt +=1
        
      if j !=0 and hwl[i][j-1] == "#":
        cnt +=1
      
      if j < w-1 and hwl[i][j+1] == "#":
        cnt +=1
        
      if i < h-1 and j != 0 and hwl[i+1][j-1] == "#":
        cnt +=1
      
      if i <h-1 and hwl[i+1][j] == "#":
        cnt +=1
        
      if i < h-1 and j < w-1 and hwl[i+1][j+1] == "#":
        cnt +=1
        
      hwl[i][j] = str(cnt)

  print("".join(hwl[i]))
      
   

Fixed submission:
h,w = map(int,input().split())
hwl = []
for _ in range(h):
  l = list(input())
  hwl.append(l)
  
for i in range(h):
  for j in range(w):
    if hwl[i][j] == ".":
      cnt = 0
      if i != 0 and j !=0 and hwl[i-1][j-1] == "#":
        cnt +=1
      
      if i != 0 and hwl[i-1][j] == "#":
        cnt +=1
      
      if i != 0 and j < w-1 and  hwl[i-1][j+1] == "#":
        cnt +=1
        
      if j !=0 and hwl[i][j-1] == "#":
        cnt +=1
      
      if j < w-1 and hwl[i][j+1] == "#":
        cnt +=1
        
      if i < h-1 and j != 0 and hwl[i+1][j-1] == "#":
        cnt +=1
      
      if i <h-1 and hwl[i+1][j] == "#":
        cnt +=1
        
      if i < h-1 and j < w-1 and hwl[i+1][j+1] == "#":
        cnt +=1
        
      hwl[i][j] = str(cnt)

  print("".join(hwl[i]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
lr = [int(i) for i in input().split()]

ans = 0

for i in range(n):
  ans += lr[i][1] -lr[i][0] +1
  
  
print(ans)

Fixed submission:
n = int(input())
lr = [[int(i) for i in input().split()] for _ in range(n)]

ans = 0

for i in range(n):
  ans += (lr[i][1] - lr[i][0]) +1
  
  
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = inr(input())
A = Counter([int(input()) for i in range(N)])
print(sum(1 if count%2 else 0 for count in A.values()))

Fixed submission:
n = int(input())
d = {}
for i in range(n):
    a = int(input())
    if a in d:
        del d[a]
    else:
        d[a] = 1
print(len(d))

Buggy python submission (verdict: Runtime Error):
n =int(input())
a =list(int(input()) for i in range(n))

dict = {}
for i in range(n):
  if not(a[i] in dict):
    dict(a[i]) =1
  if s[i] in dict:
    dict.pop(a[i])
    
print(len(dict))
  


Fixed submission:
n = int(input())
d = {}
for i in range(n):
    a = int(input())
    if a in d:
        del d[a]
    else:
        d[a] = 1
print(len(d))

Buggy python submission (verdict: Runtime Error):
n =int(input())
a =[int(input()) for i in range(n)]

dict = {}
for i in range(n):
  if not(a[i] in dict):
    dict(a[i]) =1
  if s[i] in dict:
    dict.pop(a[i])
    
print(len(dict))
  


Fixed submission:
n = int(input())
d = {}
for i in range(n):
    a = int(input())
    if a in d:
        del d[a]
    else:
        d[a] = 1
print(len(d))

Buggy python submission (verdict: Runtime Error):
n =int(input())
a =[int(input()) for i in range(n)]

dict = {}
for i in range(n):
  if not(a[i] in dict):
    dict(a[i]) ==1
  if s[i] in dict:
    dict.pop(a[i])
    
print(len(dict))
  

Fixed submission:
n = int(input())
d = {}
for i in range(n):
    a = int(input())
    if a in d:
        del d[a]
    else:
        d[a] = 1
print(len(d))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
A = Counter(list(map(int,input().split())))

x = [0]
for a in A:
  if A[a]>1:x.append(a)
  if A[a]>3:x.append(a)
x.sort()
print(x[-1]*x[-2])



Fixed submission:
from collections import Counter
N = int(input())
A = Counter(list(map(int,input().split())))

x = [0,0]
for a in A:
  if A[a]>1:x.append(a)
  if A[a]>3:x.append(a)
x.sort()
print(x[-1]*x[-2])
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

if b <= c:
  print(0)
  exit()
  
if b <= d:
  print(b-c)
else:
  print(d-c)


Fixed submission:
N = input()

print("Yes" if N[0] == N[2] else "No")
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

if a <= c:
  if b <= c:
    print(0)
    exit()
  
  if b <= d:
    print(b-c)
  elif b >d:
    print(d-c)
    
    
if a > c:
  if d <= a:
    print(0)
    eixt()
    
  if d <= b:
    print(d-a)
  elif d > b:
    print(b-a)



Fixed submission:
a, b, c, d = map(int, input().split())
ans = 0
for i in range(0, 101):
    if a < i <= b and c < i <= d:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()

a = s[0]
b =len(s)-2
c = s[-1]

print(a+b+c)


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

print((n-1)*(m-1))

Buggy python submission (verdict: Runtime Error):
s = input()

a = s[0]
b =len(s[1:len(s)-1])
c = s[-1]

print(a+b+c)


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

print((n-1)*(m-1))
Buggy python submission (verdict: Runtime Error):
s = input()

a = s[0]
b =len( s[1:len(s)-1])
c = s[len(s)]

print(a+b+c)


Fixed submission:
s = input()

a = s[0]
b =len(s)-2
c = s[-1]

print( str(a) + str(b) + str(c))

Buggy python submission (verdict: Runtime Error):
s = input()

a = s[1]
b =len( s[2:len(s)-1])
c = s[-1]

print(a+b+c)


Fixed submission:
s = input()

a = s[0]
b =len(s)-2
c = s[-1]

print( str(a) + str(b) + str(c))
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())

list = [int(i) for i in input().split()]

list.sort(reverse=True)

ans = 0
for i in range(K):
  ans += list[i]
  
  
print(ans)

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

if a % 3 ==0 or b % 3 ==0 or (a+b) % 3 ==0:
  print("Possible")
  
else:
  print("Impossible")
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = {i+1:int(input()) for i in range(N)}
d = D{1}
ans = 1


for i in range(N):
  if d==2:
    print(ans)
    exit()
    
  d = D[d]
  ans +=1
  
  
print(-1)

Fixed submission:
N = int(input())
D = {i+1:int(input()) for i in range(N)}
d = D[1]
ans = 1


for i in range(N):
  if d==2:
    print(ans)
    exit()
    
  d = D[d]
  ans +=1
  
  
print(-1)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

if a>b:
  print("GREATER")
elif a==b:
  print("EQUAL")
  
else:
  print("LESS")

Fixed submission:
a = int(input())
b = int(input())

if a>b:
  print("GREATER")
elif a==b:
  print("EQUAL")
  
else:
  print("LESS")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

ans = 1
up,down = False,False
for i in range(N-1):
  if A[i] < A[i+1]:
    up = True
  elif A[i] > A[i+1]:
    down = True
  if up and dn:
    ans +=1
    up,down = False,False
    
print(ans)

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

ans = 1
up, dn = False, False
for i in range(N-1):
    if A[i] < A[i+1]:
        up = True
    elif A[i] > A[i+1]:
        dn = True
    if up and dn:
        ans += 1
        up, dn = False, False
print(ans)
Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
ans = []

for i in range(len(o)):
  o.append(o[i])
  
for j in range(len(e)):
  e.append(e[j])
  
if len(o) == len(e):
  for k in range(len(o)):
    ans.append(o[k])
    ans.append(e[k])
    
  print("".join(ans))
  exit()
  
if len(o) != len(e):
  for l in range(len(e)):
    ans.append(o[l])
    ans.append(e[l])
    
  ans.append(o[-1])
  exit()
    
  

Fixed submission:
O = input()
E = input()
o = []
e=[]
ans = []

for i in range(len(O)):
  o.append(O[i])
  
for j in range(len(E)):
  e.append(E[j])
  
if len(o) == len(e):
  for k in range(len(o)):
    ans.append(o[k])
    ans.append(e[k])
    
  print("".join(ans))
  exit()
  
if len(o) != len(e):
  for l in range(len(e)):
    ans.append(o[l])
    ans.append(e[l])
    
  ans.append(o[-1])
  print("".join(ans))
  exit()
Buggy python submission (verdict: Runtime Error):
w,a,b = map(int,input().split())

if a < b:
  if b-(a+w) >0:
    print(b-(a+w))
  else:
    print(0)
    
elif a==b:
  print(0)
  
eif a>b:
  if a-(b+w) >0:
    print(a-(b+w))
  else:
    print(0)
  

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

if a < b:
  if b-(a+w) >0:
    print(b-(a+w))
  else:
    print(0)
    
elif a==b:
  print(0)
  
elif a>b:
  if a-(b+w) >0:
    print(a-(b+w))
  else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n,c,k = map(int,input().split())
t = [int(input()) for i in range(n)]
t.sorted()

pas = 1
last_bus = t[0] + k
ans = 1

for i in t[1:]:
  if i <= last_bus and pas < c:
    pas +=1
  else:
    ans +=1
    pas =1
    last_bus = i + k
    
    
print(ans)
  
  


Fixed submission:
n,c,k = map(int,input().split())
t = [int(input()) for i in range(n)]
t.sort()

pas = 1
last_bus = t[0] + k
ans = 1

for i in t[1:]:
  if i <= last_bus and pas < c:
    pas +=1
  else:
    ans +=1
    pas =1
    last_bus = i + k
    
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())


k=1
for i in range(1,n+1):
  k = k * i
print(k % (10**9 + 7))
  
 


Fixed submission:
n = int(input())

x = (10**9 + 7)
k=1
for i in range(1,n+1):
  k = k * i
  k = k%x

print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())


k=1
for i in range(1,n+1):
  k = k * i

  
  
if k <(10**9 + 7):
  print(k)
else:
  print(k % (10**9 + 7))


Fixed submission:
n = int(input())

x = (10**9 + 7)
k=1
for i in range(1,n+1):
  k = k * i
  k = k%x

print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

x = (10**9 + 7)
k=1
for i in range(1,n+1):
  k = k * i

  
  
if k <x:
  print(k)
else:
  print(k % x)


Fixed submission:
n = int(input())

x = (10**9 + 7)
k=1
for i in range(1,n+1):
  k = k * i
  k = k%x

print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

x = (10**9 + 7)
k=1
for i in range(1,n+1):
  k = k * i

  
  

print(k % x)

Fixed submission:
n = int(input())

x = (10**9 + 7)
k=1
for i in range(1,n+1):
  k = k * i
  k = k%x

print(k)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [[str(i) for i in input()]for _ in range(n)]
b = [[str(i) for i in input()]for _ in range(m)]

for i in range(n-m+1):
  for j in range(n-m+1):
    c =0
    for k in range(n-m+1):
      for l in range(n-m+1):
        if a[i+k][j+l] == b[k][l]:
          c +=1
          
      
  if c == 2*m:
    print("Yes")
    exit()
      
      
      
print("No")

Fixed submission:
n,m = map(int,input().split())
a = [[str(i) for i in input()]for _ in range(n)]
b = [[str(i) for i in input()]for _ in range(m)]

for i in range(n-m+1):
  for j in range(n-m+1):
    c =0
    for k in range(m):
      for l in range(m):
        if a[i+k][j+l] == b[k][l]:
          c +=1
          
          
    
    if c == m**2:
      print("Yes")
      exit()
      
      
      
print("No")
Buggy python submission (verdict: Runtime Error):
s =input()
A=0
Z=0

for i in range(len(s)):
  s[i] =="A":
    A +=i+1
    break

    
for j in range(len(s)):
  s[-(j+1)] =="Z":
    Z +=len(s)-j
    break
    
print(Z-A+1)
    
    


Fixed submission:
s = input()

id_a = len(s)
id_z = 0
for i in range(len(s)):
  if s[i] == 'A':
    id_a = min(id_a, i)
  if s[i] == 'Z':
    id_z = max(id_z, i)
    
print(id_z - id_a + 1)

Buggy python submission (verdict: Runtime Error):
s =input()
A=0
Z=0

for i in range(len(s)):
  s[i] =="A":
    A=i+1
    break

    
for j in range(len(s)):
  s[-(j+1)] =="Z":
    Z=len(s)-j
    break
    
print(Z-A+1)
    
    

Fixed submission:
s = input()

id_a = len(s)
id_z = 0
for i in range(len(s)):
  if s[i] == 'A':
    id_a = min(id_a, i)
  if s[i] == 'Z':
    id_z = max(id_z, i)
    
print(id_z - id_a + 1)
Buggy python submission (verdict: Runtime Error):
K,S = map(int,input().split())

ans = 0

for x in range(K + 1):
  for y in range (K + 1):
    z = S - (x + y)
    if 0 <= z <= k:
      ans += 1

print(ans)



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

ans = 0

for x in range(K + 1):
  for y in range (K + 1):
    z = S - (x + y)
    if 0 <= z <= K:
      ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import re

s = ainpu()
s = re.sub("eraser","",s)
s = re.sub("erase","",s)
s = re.sub("dreamer","",s)
s = re.sub("dream","",s)
print("Yes" if len(s) ==0 else "No")

Fixed submission:
import re

s = input()
s = re.sub("eraser","",s)
s = re.sub("erase","",s)
s = re.sub("dreamer","",s)
s = re.sub("dream","",s)

if len(s) == 0:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())

ans = 0
for i in range(a,b+1):
  if i % x==0 :ans += 1
    
print(ans)


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


ans = b//x - (a-1)//x
print(ans)

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

ans = 0
for i in range(a,b+1):
  if i % x==0 :ans. +=1
    
print(ans)

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


ans = b//x - (a-1)//x
print(ans)
Buggy python submission (verdict: Runtime Error):
A=list(map(int,input().split())) +[0]
ans =0
for i in range(N):
  eated =max(0,A[i]+A[i-1]-x)
  ans +=eated
  A[i]-=eated
  
print(ans)

Fixed submission:
N,x =map(int,input().split())
a=[int(i) for i in input().split()]
ans=0
if a[0] >x:
  ans += (a[0]-x) 
  a[0] -= (a[0]-x) 
  

for i in range(N-1):
  if a[i]+a[i+1] >x:
    ans += ((a[i]+a[i+1])-x)
    a[i+1] -= ((a[i]+a[i+1])-x)
    
  else: continue
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())

print(k*((k-1)**(n-1))


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

print(k*((k-1)**(n-1)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())

print(k*((k-1)*(n-1))

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

print(k*((k-1)**(n-1)))
Buggy python submission (verdict: Runtime Error):
if 1 == int(input()):
  print(0)
else
  print(1)

Fixed submission:
if 1 == int(input()):
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A,B,C,D = map(int,input().split())
A -= 1

E = lcm(C,D)

print(B - B // C - B // D + B // E - (A - A // C - A // D + A // E))

Fixed submission:
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

A,B,C,D = map(int,input().split())
A -= 1

E = lcm(C,D)

print(B - B // C - B // D + B // E - (A - A // C - A // D + A // E))
Buggy python submission (verdict: Runtime Error):
S = input()
L = [" "]
for s in S:
  if s == 'A':
    L.append('0')
  elif s == 'B':
    L.append('B')
  elif s == 'C' and L[-1] == 'B':
    L[-1] = '1'
  else:
    L.append('C')

ans = 0
a = 0
while True:
  a = 0
  for i in range(1,len(L)):
    if L[i] == '0' and L[i + 1] == '1':
      L[i],L[i + 1] = L[i + 1],L[i]
      ans += 1
      a += 1
#      print("".join(L),i)
  if a == 0:
    print(ans)
    break
    

Fixed submission:
S = input()
L = [" "]
for s in S:
  if s == 'A':
    L.append('0')
  elif s == 'B':
    L.append('B')
  elif s == 'C' and L[-1] == 'B':
    L[-1] = '1'
  else:
    L.append('C')

def func(a,b):
#  print(a,b)
  return a * b

ans = 0
a,b = 0,0
i = 0
while i < len(S):
  if S[i] == 'A':
    if b != 0:
      ans += func(a,b)
      b = 0
    a += 1
  elif S[i:i + 2] == 'BC':
    b += 1
  elif S[i - 1:i + 1] == "BC":
    ()
  else:
    ans += func(a,b)
    a,b = 0,0
  i += 1
print(ans + func(a,b))
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
X = list(map(int,input().split()))
if M == 1:
  print(0)
else:
  X.sort()
  A = [X[a + 1] - X[a] for a in range(M - 1)]
  A.sort(reverse=True)
  ans = X[-1] - X[0]
  for i in range(min(N - 1,M)):
    ans -= A[i]
  print(ans)

Fixed submission:
N,M = map(int,input().split())
X = list(map(int,input().split()))
if M == 1:
  print(0)
else:
  X.sort()
  A = [X[a + 1] - X[a] for a in range(M - 1)]
  A.sort(reverse=True)
  ans = X[-1] - X[0]
  for i in range(min(N - 1,M - 1)):
    ans -= A[i]
  print(ans)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
X = list(map(int,input().split()))
if M == 1:
  print(0)
else:
  X.sort()
  A = [X[a + 1] - X[a] for a in range(M - 1)]
  A.sort(reverse=True)
  ans = X[-1] - X[0]
  for i in range(min(N - 1,M)):
    ans -= A[i]
  print(ans)

Fixed submission:
N,M = map(int,input().split())
X = list(map(int,input().split()))
if M == 1:
  print(0)
else:
  X.sort()
  A = [X[a + 1] - X[a] for a in range(M - 1)]
  A.sort(reverse=True)
  ans = X[-1] - X[0]
  for i in range(min(N - 1,M - 1)):
    ans -= A[i]
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = [A[i] - B[i] for i in range(0,N)]
C.sort()
p = 0
ans = 0
for i in range(0,N):
  if C[i] < 0:
    p += C[i]
    ans += 1
  else:
    break
  if p < 0:
    for j in range(N - 1,0,-1):
      if C[j] > 0:
        p += C[j]
        ans += 1
        C[j] = 0
        break

if sum(A) < sum(B):
  print(-1)
else:
  print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = [A[i] - B[i] for i in range(0,N)]
C.sort()
p = 0
ans = 0
j = len(A) - 1
for i in range(0,N):
  if C[i] < 0:
    p += C[i]
    ans += 1
  else:
    break
  if p < 0:
    if C[j] > 0:
      p += C[j]
      ans += 1
      C[j] = 0
      j -= 1

if sum(A) < sum(B):
  print(-1)
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
print("Christmas",["Eve "] * 25 - N)

Fixed submission:
N = int(input())
print("Christmas","Eve " * (25 - N))
Buggy python submission (verdict: Runtime Error):
S = input()
ans = 9999
for i in range(0,7):
  n = int(S[i:i + 3])
  ans = min(ans,abs(753 - n))
print(ans)

Fixed submission:
S = input()
ans = 9999
for i in range(0,len(S) - 1):
  n = int(S[i:i + 3])
  ans = min(ans,abs(753 - n))
print(ans)

Buggy python submission (verdict: Runtime Error):
S = input()
ans = 99999
for i in range(7):
  n = int(S[i:i + 2])
  ans = min(ans,abs(n - 754))
print(ans)

Fixed submission:
S = input()
ans = 9999
for i in range(0,len(S) - 1):
  n = int(S[i:i + 3])
  ans = min(ans,abs(753 - n))
print(ans)
Buggy python submission (verdict: Runtime Error):
i = list(map(int,input(),split()))
print(i[0] - i[1] + 1)

Fixed submission:
i = list(map(int,input().split()))
print(i[0] - i[1] + 1)

Buggy python submission (verdict: Runtime Error):
i = list(map(int,input(),split()))
print(i[0] - i[1] + 1)

Fixed submission:
i = list(map(int,input().split()))
print(i[0] - i[1] + 1)
Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():

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

  su = np.sum(A)
  av = su // N
  if su % N != 0:
    print(-1)
    return

  ans = N - 1
  b = 0
  c = 0

  for a in A[0: -1]:
    b += a
    c += 1
    if b == (c * av):
      ans -= 1
      b = 0
      c = 0

  print(ans)

main()

Fixed submission:
import numpy as np

def main():

  W, A, B = map(int, input().split())
  
  A_ = A + W
  B_ = B + W
  
  if (A <= B and B <= A_) or (A <= B_ and B_ <= A_):
    print(0)
    return

  print(min(abs(A_ - B), abs(A - B_)))

main()
Buggy python submission (verdict: Runtime Error):
n=int(input())
sum=0
while (n!=0):
  sum+=int(n%10)
  n/=10
if (sum%9==0):
  print("Yes")
else:
  print("No")


Fixed submission:

def check(st) : 

	n = len(st) 
	digitSum = 0
	
	for i in range(0,n) : 
		digitSum = digitSum + (int)(st[i]) 

	
	return (digitSum % 9 == 0) 


st =input()

if(check(st)) : 
	print("Yes") 
else : 
	print("No")

Buggy python submission (verdict: Runtime Error):
n=int(input())
sum=0
while (n!=0):
  sum+=int(n%10)
  n/=10
print(sum)
if (sum%9==0):
  print("Yes")
else:
  print("No")


Fixed submission:

def check(st) : 

	n = len(st) 
	digitSum = 0
	
	for i in range(0,n) : 
		digitSum = digitSum + (int)(st[i]) 

	
	return (digitSum % 9 == 0) 


st =input()

if(check(st)) : 
	print("Yes") 
else : 
	print("No")
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <stack>
#pragma GCC optimize(3 , "Ofast" , "inline")
using namespace std ;
typedef long long ll ;
const double esp = 1e-6 , pi = acos(-1) ;
typedef pair<int , int> PII ;
const int N = 1e5 + 10 , INF = 0x3f3f3f3f , mod = 1e9 + 7;
ll in()
{
  ll x = 0 , f = 1 ;
  char ch = getchar() ;
  while(!isdigit(ch)) {if(ch == '-') f = -1 ; ch = getchar() ;}
  while(isdigit(ch)) x = x * 10 + ch - 48 , ch = getchar() ;
  return x * f ;
}
int main()
{
  ll a = in() , b = in() , n = in() ;
  ll l = 0 , r = n , ans = 0 ;
  while(l < r)
   {
     ll mid = l + r + 1 >> 1 ;
     if((a * mid) / b - a * (mid / b) >= ans) l = mid ;
     else r = mid - 1 ;
   }
  cout << (a * r) / b - a * (r / b) << endl ;
  return 0 ;
}
/*
*/


Fixed submission:
a , b , n = map(int , input().split())
l = 0
r = n
ans = 0
while (l < r) :
    mid = (l + r + 1) // 2
    if  (a * mid) // b - a * (mid // b) >= ans :
         ans =  (a * mid) // b - a * (mid // b)
         l = mid
    else :
        r = mid - 1
print((a * r) // b - a * (r // b))
Buggy python submission (verdict: Runtime Error):
a = input()
print(!a)

Fixed submission:
a = int(input())
if a == 0:
    print(1)

if a == 1:
    print(0)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
di = K * 2
l = []

for i in range (di):
    l.append(int(input()))

l1 = []
x = 1
while x < di:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l1)
print(N - len(l1))

Fixed submission:
N, K = map(int, input().split())
di = K * 2
l = []
for i in range (di):
    l.append(input().split())
l1 = []
x = 1
while x < di:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l1)
print(N - len(l1))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
l = []

for i in range (K * 2):
    l.append(int(input())
l1 = []
x = 1
while x < K * 2:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l)
print(N - len(l1))

Fixed submission:
N, K = map(int, input().split())
di = K * 2
l = []
for i in range (di):
    l.append(input().split())
l1 = []
x = 1
while x < di:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l1)
print(N - len(l1))
Buggy python submission (verdict: Runtime Error):
A, B, N = map(int, input().split())
if N < B:
    print(A*N//B)
else:
    l = [(A*i//B)-(A*(i//B)) for i in range(abs(N-5), N+1)]
    print(max(l))

Fixed submission:
K = int(input())
A, B = map(int, input().split())
result = 'NG'
for i in range (A, B + 1):
    if i % K == 0:
        result = 'OK'
print(result)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
while True:
    c - = b
    if c <= 0:
        print('No')
        break
    a - = d
    if a <= 0:
        print('Yes')
        break

Fixed submission:
a, b, c, d = map(int, input().split())
while True:
    c-=b
    if c <= 0:
        print('Yes')
        break
    a-= d
    if a <= 0:
        print('No')
        break
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
l1 = []
for i in range (m):
    ai = int(input())
    l1.append(ai)
s = sum(l1)
r = (n - s)
if r >= 0:
    print(r)
else:
    print("-1")

Fixed submission:
import math
r = int(input())
p = math.pi
a = p * (r * 2)
print(a)

Buggy python submission (verdict: Runtime Error):
n, m = input().split()
ni = int(n)
mi = int(m)
l1 = []
for i in range (mi):
    ai = int(input())
    l1.append(ai)
s = sum(l1)
r = (ni - s)
if r >= 0:
    print(r)
else:
    print("-1")

Fixed submission:
import math
r = int(input())
p = math.pi
a = p * (r * 2)
print(a)