Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
n = N
import math
sq = math.sqrt(M)
while n<M :
    if M%n == 0:
        g = M//n
        print(g)
        exit()
    else:
        n += 1
print(1)



Fixed submission:
N,M=map(int,input().split())
import math
s = math.sqrt(M)
sq = math.floor(s)
l = []
for i in range(1,sq+1):
    if M%i == 0:
        l.append(i)
        l.append(M//i)
ans = 1
for r in l:
    n = M//r
    if n >= N:
        ans = max(ans,r)
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
f = [-1 for _ in range(130)]
g = [-1 for _ in range(130)]
ans = "Yes"
for i in len(S):
  s = ord(S[i])
  t = ord(T[i])
  if f[s] == -1:
    f[s] = t
  else:
    if f[s] != t:
      ans = "No"
  if g[t] == -1:
    g[t] = s
  else:
    if g[t] != s:
      ans = "No"
print(ans)

Fixed submission:
S = input()
T = input()
L = len(S)
dicS = {}
dicT = {}
ans = "Yes"
for i in range(L):
    if S[i] not in dicS:
        dicS[S[i]] = T[i]
    else:
        if T[i] != dicS[S[i]]:
            ans ="No"
    if T[i] not in dicT:
        dicT[T[i]] = S[i]
    else:
        if S[i] != dicT[T[i]]:
            ans = "No"
print(ans)
Buggy python submission (verdict: Runtime Error):
N,X = map(int,input().split())
x = list(map(int,input().split()))
for i in range(N):
  x[i] -= X
import fractions
g = fractions.gcd(x[0],x[1])
for i in range(2,N):
  g = fractions.gcd(g,x[i])
print(g)


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

def gcd( x, y ):
    while y != 0:
        x, y = y, x%y
    return(x)
    

xs[0] -= X
g = xs[0]
import math
for i in range(1,N):
    xs[i] -= X
    g = gcd(g,xs[i])
print(abs(g))

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

xs[0] -= X
g = xs[0]
import math
for i in range(1,N):
    xs[i] -= X
    g = math.gcd(g,xs[i])
print(g)

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

def gcd( x, y ):
    while y != 0:
        x, y = y, x%y
    return(x)
    

xs[0] -= X
g = xs[0]
import math
for i in range(1,N):
    xs[i] -= X
    g = gcd(g,xs[i])
print(abs(g))
Buggy python submission (verdict: Time Limit Exceeded):
import heapq as hq
from collections import deque
n,m,s,t=map(int,input().split())
yenLinks={}
snkLinks={}
for _ in range(m):
    u,v,a,b=map(int,input().split())
    if u not in yenLinks:
        yenLinks[u]=[(v,a)]
        snkLinks[u]=[(v,b)]
    else:
        yenLinks[u].append((v,a))
        snkLinks[u].append((v,b))
    if v not in yenLinks:
        yenLinks[v]=[(u,a)]
        snkLinks[v]=[(u,b)]
    else:
        yenLinks[v].append((u,a))
        snkLinks[v].append((u,b))
#Dijkstra
INF=100000000000001
for i in range(1,n+1):
    yenDijk=[[INF,0] for _ in range(n+1)] #Distance,Determined index0 never used#
    snkDijk=[[INF,0] for _ in range(n+1)]

#yen route
pQueue=[(0,s)]
yenDijk[s]=[0,0]
hq.heapify(pQueue)

while pQueue:
    d,v = hq.heappop(pQueue)
    if yenDijk[v][1]:
        continue
    else:
        yenDijk[v][1] = 1
    for (w,D) in yenLinks[v]:
        if yenDijk[w][1]:
            continue
        else:
            if yenDijk[w][0]>yenDijk[v][0]+D:
                yenDijk[w][0] = yenDijk[v][0]+D
                hq.heappush(pQueue,(yenDijk[w][0],w))

#snuuk route
pQueue=[(0,t)]
snkDijk[t]=[0,0]
hq.heapify(pQueue)

while pQueue:
    d,v = hq.heappop(pQueue)
    if snkDijk[v][1]:
        continue
    else:
        snkDijk[v][1] = 1
    for (w,D) in snkLinks[v]:
        if snkDijk[w][1]:
            continue
        else:
            if snkDijk[w][0]>snkDijk[v][0]+D:
                snkDijk[w][0] = snkDijk[v][0]+D
                hq.heappush(pQueue,(snkDijk[w][0],w))
#OUTPUT
i = n
ans = INF
answers=[]
while i>0:
    ans = min(ans,yenDijk[i][0]+snkDijk[i][0])
    answers.append(1000000000000000-ans)
    i-=1
answers.reverse()
for ans in answers:
    print(ans)

Fixed submission:
import heapq as hq
from collections import deque
n,m,s,t=map(int,input().split())
#リンク情報をつくる
yenLinks={}
snkLinks={}
for _ in range(m):
    u,v,a,b=map(int,input().split())
    if u not in yenLinks:
        yenLinks[u]=[(v,a)]
        snkLinks[u]=[(v,b)]
    else:
        yenLinks[u].append((v,a))
        snkLinks[u].append((v,b))
    if v not in yenLinks:
        yenLinks[v]=[(u,a)]
        snkLinks[v]=[(u,b)]
    else:
        yenLinks[v].append((u,a))
        snkLinks[v].append((u,b))
#Dijkstra法をする関数
INF=float('inf')
def dijkstra(start,links,nodeNum):
    ans=[INF for _ in range(nodeNum+1)]
    ans[start]=0
    PQ=[(0,start)]
    hq.heapify(PQ)
    while PQ:
        (Vd,V) = hq.heappop(PQ)
        #print([V,Vd,ans[V]])
        if Vd > ans[V]:
            continue
        for (W,D) in links[V]:
            cand = ans[V] + D
            if cand < ans[W]:
                ans[W] = cand
                hq.heappush(PQ,(ans[W],W))
            #print(PQ)
    return(ans)
#Dijkstra法実行
yenKstra=dijkstra(s,yenLinks,n)
snkKstra=dijkstra(t,snkLinks,n)
#答えを求める
i=n
ans=INF
answers=[]
while i>0:
    cand = yenKstra[i]+snkKstra[i]
    ans = min(ans,cand)
    answers.append(10**15-ans)
    i-=1
answers.reverse()
#出力
for ans in answers:
    print(ans)
Buggy python submission (verdict: Runtime Error):
N=input()
a=list(map(int,input().split()))
mini=maxi=a[0]
for i in range(1,N):
  mini=min(mini,a[i])
  maxi=max(maxi,a[i])
print(maxi-mini)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
mini=maxi=a[0]
for i in range(1,N):
  mini=min(mini,a[i])
  maxi=max(maxi,a[i])
print(maxi-mini)
Buggy python submission (verdict: Runtime Error):
X,Y,Z = map(int,input.split(" "))
ans = (X-Z)//(Y+Z)
print(ans)

Fixed submission:
X,Y,Z = map(int,input().split(" "))
ans = (X-Z)//(Y+Z)
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 = list(map(int,input().split(" ")))
alpha = []
for i in range(N):
  list = [number for number in b if number > a[i]]
  alpha.append(list)
beta={}
for i in range(N):
  number = len([x for x in c if x > b[i]])
  beta[b[i]] = number

ans = 0
for i in range(N):
  for x in alpha[i]:
    ans += beta[x]

print(ans)
      

Fixed submission:
N = int(input())
a = list(map(int,input().split(" ")))
b = list(map(int,input().split(" ")))
c = list(map(int,input().split(" ")))
#アルゴリズムわからないけどN log N?
a.sort()
b.sort()
c.sort()

#O(N)?
i,j,k = 0,0,0
ans = 0
while j < N:
  while i < N and a[i]<b[j] :
    i += 1
  while k < N and c[k]<=b[j]:
    k += 1
  ans += i * (N - k)
  j += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,C,D,E,F=map(int,input().split())
#100*A*i + 200*B*j == x
#C*i + D*j == y
xs = []
ys = []
def dens(x,y):
    if x+y==0:
        return(-1)
    else:
        return(y/(x+y))
for i in range(31):
    for j in range(16):
        if 100*A*i + 200*B*j <= F:
            xs.append(100*A*i + 200*B*j)
for i in range(3001):
    for j in range(1501):
        if C*i + D*j <= F:
            ys.append(C*i + D*j)
density = 0
for x in xs:
    for y in ys:
        if x+y > F or 100*y > E*x:
            continue
        nd = dens(x,y)
        if nd > density:
            density = nd
            sugar = y
            water = x
            #print([sugar,water,density])
print(str(water+sugar) + " " + str(sugar))


Fixed submission:
A,B,C,D,E,F=map(int,input().split())
#100*A*i + 200*B*j == x
#C*i + D*j == y
xs = []
ys = []
def dens(x,y):
    if x+y==0:
        return(-1)
    else:
        return(y/(x+y))
for i in range(31):
    for j in range(16):
        if 100*A*i + 200*B*j <= F:
            xs.append(100*A*i + 200*B*j)
for i in range(3001):
    for j in range(1501):
        if C*i + D*j <= F:
            ys.append(C*i + D*j)
density = 0
water = 100*A
sugar = 0
for x in xs:
    for y in ys:
        if x+y > F or 100*y > E*x:
            continue
        nd = dens(x,y)
        if nd > density:
            density = nd
            sugar = y
            water = x
print(str(water+sugar) + " " + str(sugar))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
import math
sqN=math.sqrt(N)
sqN=math.floor(sqN)
i=sqN

while N%i!=0:
    i-=1
a=math.floor(math.log10(i))+1
b=math.floor(math.log10(N//i))+1
candA=max(a,b)
i=sqN
while N%i!=0:
    i+=1
a=math.floor(math.log10(i))+1
b=math.floor(math.log10(N//i))+1
candB=max(a,b)

print(min(candA,candB))

Fixed submission:
N=int(input())
import math
sqN=math.sqrt(N)
sqN=math.ceil(sqN)
i=1
ans=float('inf')
def digits(n):
    return(math.floor(math.log10(n))+1)
while i <= sqN:
    q,r=divmod(N,i)
    if r==0:
        ans=min(ans,max(digits(i),digits(q)))
    i+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
# S.reverse()
S = S[::-1]
#dream, dreamer, erase, eraser
headers = ["resare","esare","remaerd","maerd"]

def solve(str):
    if str == "":
        return(True)
    else:
        for header in headers:
            if str.startswith(header):
                return(solve(str[len(header):]))
        return(False)

if solve(S):
    print('YES')
else:
    print('NO')

Fixed submission:
S = input()
# S.reverse()
S = S[::-1]
#dream, dreamer, erase, eraser
headers = ["resare","esare","remaerd","maerd"]

result = True
while True:
    if S=="":
        result = True
        break
    result = False
    for header in headers:
        if S.startswith(header):
            S = S[len(header):]
            result = True
    if not result:
        break

if result:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
def main():
  x=int(input())
  y=int(input())
  
  if x>y:
    print(str(y)*x)
  elif x<y:
    print(str(x)*y)
  else:
    print(str(x)*y)
main()

Fixed submission:
def main():
    x, y = [int(i) for i in input().split()]
    if x > y:
        print(str(y) * x)
    elif x < y:
        print(str(x) * y)
    else:
        print(str(x) * y)
main()

Buggy python submission (verdict: Runtime Error):
def main():
  x=int(input())
  y=int(input())
  
  if x>y:
    print(str(y)*x)
  elif x<y:
    print(str(x)*y)
  else:
    print(str(x)*y)
main()
    

Fixed submission:
def main():
    x, y = [int(i) for i in input().split()]
    if x > y:
        print(str(y) * x)
    elif x < y:
        print(str(x) * y)
    else:
        print(str(x) * y)
main()

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

if x>y:
  print(str(y)*x)
elif x<y:
  print(str(x)*y)
else:
  print(str(x)*y)

Fixed submission:
def main():
    x, y = [int(i) for i in input().split()]
    if x > y:
        print(str(y) * x)
    elif x < y:
        print(str(x) * y)
    else:
        print(str(x) * y)
main()
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if(b<=0 and d<=0):
  print(a*c)
elif(b<0 or d<0):
  if(((a<0 and b>0) or (c<0 and d>0))):
    print(0)
  elif(a>0 and b>0):
    print(d*a)
  elif(c>0 and d>0):
    print(b*ChildProcessError)
else:
  print(b*d)

Fixed submission:
a,b,c,d = map(int,input().split())
if(a<=0 and b>=0 or (c<=0 and d>=0)):
  print(max(a*c,b*d,a*d,b*c,0))
else:
  print(max(a*c,b*d,a*d,b*c))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
  x=int(input())
  a.append(x)
d={}
f=0
maxi=0
for i in range(n):
  if((a[i]-1) in d):
    d[a[i]]=d[a[i]-1]+1
    if(f==0):
      maxi=d[a[i]]
    else:
      if(d[a[i]]>maxi):
        maxi=d[a[i]]
  else:
    d[a[i]]=0
print(n-maxi-1)



Fixed submission:
a,b,c,k=map(int,input().split())
if(k%2==0):
  print(a-b)
else:
  print(b-a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
list_judge=[]
for i in range (n):
  list_judge.append(str(input()))

print("AC x ",acnum=list_judge.count("AC"))
print("WA x ",wanum=list_judge.count("WA"))
print("TLE x ",tlenum=list_judge.count("TLE"))
print("RE x ",renum=list_judge.count("RE"))

Fixed submission:
n=int(input())
list_judge=[]
for i in range (n):
  list_judge.append(str(input()))

acnum=list_judge.count("AC")
wanum=list_judge.count("WA")
tlenum=list_judge.count("TLE")
renum=list_judge.count("RE")

print("AC x ",acnum)
print("WA x ",wanum)
print("TLE x ",tlenum)
print("RE x ",renum)
Buggy python submission (verdict: Runtime Error):
s=str(input())
if s.isupper()=True:
  print("A")
else:
  print("a")

Fixed submission:
s=str(input())
if s.isupper()==True:
  print("A")
else:
  print("a")
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()


ans = [len(T) -1]
for i in range(len(S)):
  if S[i] == T[0]:
    s = 0
    for j in range(1,len(T)):
      if S[i + j] == T[j]:
        pass
      else:
        s += 1
    ans.append(s)

print(min(ans))
    

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


ans = len(T)
for i in range(len(S) - len(T) + 1):
  s = 0
  for j in range(len(T)):
    if S[i + j] != T[j]:
      s += 1
  ans = min(ans, s)

print(ans)
Buggy python submission (verdict: Runtime Error):
S, W = map(int, input().split())
if S <= 2 * W:
  print("unsafe")
else:
  print(safe)

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

if W >= S:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

for i in range(1,N + 1):
  ans = 0
  for j in A:
    if i == j:
      ans += 1
    
  print(ans)

Fixed submission:
import collections

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

for i in range(1, N + 1):
  print(a[i])
Buggy python submission (verdict: Time Limit Exceeded):

N, K = map(int,input().split())
#abstract = abs(N - K)

while abs(N - K) < N:
  N = abs(N - K)

print(N)
  

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

print(min(N % K, K - (N % K)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))

ans = 0
for i in range(N):
  a = True
  for j in range(i):
    if P[i] <= P[j]:
      a = True
    else:
      a = False
      break
  if a == True:
    ans += 1

print(ans)

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

ans = 0
m_P = P[0]
for i in range(N):
  if P[i] <= m_P:
    ans += 1
    m_P = P[i]
print(ans)

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

ans = 1
for i in range(1,N):
  pi = P[i]
  pm = min(P[:i])
  if pi <= pm:
    ans +=1

print(ans)

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

ans = 0
m_P = P[0]
for i in range(N):
  if P[i] <= m_P:
    ans += 1
    m_P = P[i]
print(ans)

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

ans = 1
for i in range(1,N):
  pi = p[i]
  pm = min(P[:i])
  if pi <= pm:
    ans +=1

print(ans)

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

ans = 0
m_P = P[0]
for i in range(N):
  if P[i] <= m_P:
    ans += 1
    m_P = P[i]
print(ans)

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

ans = 1
for i in range(1,N):
  if P[i] <= min(P[:i]):
    ans +=1

print(ans)

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

ans = 0
m_P = P[0]
for i in range(N):
  if P[i] <= m_P:
    ans += 1
    m_P = P[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int,input().split())

a = 100000000000
for i in range(L,R + 1):
  if a == 0:
    break
  for j in range(i + 1,R + 1):
    if a >= i * j % 2019:
      a = i * j % 2019
    elif a == 0:
      break
  

print(a)

Fixed submission:
L, R = map(int,input().split())

a = 100000000000
for i in range(L,R + 1):
  if a == 0:
    break
  for j in range(i + 1,R + 1):
    if a >= i * j % 2019:
      a = i * j % 2019
      if a == 0:
        break
  

print(a)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int,input().split())

a = 100000000000
for i in range(L,R + 1):
  for j in range(i + 1,R + 1):
    if a >= i * j % 2019:
      a = i * j % 2019
    elif a == 0:
      break
  

print(a)

Fixed submission:
L, R = map(int,input().split())

a = 100000000000
for i in range(L,R + 1):
  if a == 0:
    break
  for j in range(i + 1,R + 1):
    if a >= i * j % 2019:
      a = i * j % 2019
      if a == 0:
        break
  

print(a)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int,input().split())

a = []
for i in range(L,R + 1):
  for j in range(i + 1,R + 1):
    a.append(i * j % 2019)

print(min(a))

Fixed submission:
L, R = map(int,input().split())

a = 100000000000
for i in range(L,R + 1):
  if a == 0:
    break
  for j in range(i + 1,R + 1):
    if a >= i * j % 2019:
      a = i * j % 2019
      if a == 0:
        break
  

print(a)
Buggy python submission (verdict: Runtime Error):
N, X = map(int,input().split())
L = list(map(int,input().split()))

ans = 0
D = 0
for i in range(N + 1):
  if D <= X:
    D += L[i]
    ans += 1
  else:
    break

print(ans)


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

ans = 0
D = 0
for i in range(N + 1):
  if i == 0:
    ans += 1
  else:
    D += L[i - 1]
    if D <= X:
      ans += 1
    else:
      break

print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
x = []
if A >= B:
    for i in range(1,A):
        if A % i == 0 and B % i == 0:
            x.append(i)
else:
    for i in range(1,B):
        if A % i == 0 and B % i == 0:
            x.append(i)

print(x[K-1])
  

Fixed submission:
a, b, k = map(int, input().split())
print([i for i in range(1,101) if a%i+b%i<1][-k])

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
x = []
if A >= B:
    for i in range(1,A):
        if A % i == 0 and B % i == 0:
            x.append(i)
else:
    for i in range(1,B):
        if A % i == 0 and B % i == 0:
            x.append(i)
x.sort(reverse=True)
print(x[K - 1])
  

Fixed submission:
a, b, k = map(int, input().split())
print([i for i in range(1,101) if a%i+b%i<1][-k])

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
x = []
if A >= B:
  for i in range(1,A):
    if A % i == 0 and B % i == 0:
      x.append(i)
else:
  for i in range(1,B):
    if A % i == 0 and B % i == 0:
      x.append(i)
x.sort(reverse=True)
print(x[K - 1])
  

Fixed submission:
a, b, k = map(int, input().split())
print([i for i in range(1,101) if a%i+b%i<1][-k])

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
x = []
if A >= B:
  for i in range(1,A):
    if A % i == 0 and B % i == 0:
      x.append(i)
else:
  for i in range(1,B):
    if A % i == 0 and B % i == 0:
      x.append(i)
print(x[K - 1])
  

Fixed submission:
a, b, k = map(int, input().split())
print([i for i in range(1,101) if a%i+b%i<1][-k])

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
x = []
if A >= B:
  for i in range(1,A):
    if A % i == 0 and B % i == 0:
      x.append(i)
else:
  for i in range(1,B):
    if A % i == 0 and B % i == 0:
      x.append(i)
print(x[-K])
  

Fixed submission:
a, b, k = map(int, input().split())
print([i for i in range(1,101) if a%i+b%i<1][-k])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = set(map(int,input().split()))

while len(A) > 1:
  min_A = min(A)
  next_A = set([min_A])
  for i in A:
    B = i % min_A
    if B != 0:
      next_A.add(B)
  A = list(next_A)
print(A[0])

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

while len(A) > 1:
  min_A = min(A)
  next_A = set([min_A])
  for i in A:
    B = i % min_A
    if B != 0:
      next_A.add(B)
  A = list(next_A)
print(list(A)[0])
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int,input().split()))
L_copy = L.copy()
max = max(L)
L_copy.pop(L.index(min))

if max > sum(L_copy):
  print("Yes")
else:
  print("No")


Fixed submission:
N = int(input())
L = list(map(int,input().split()))
L_copy = L.copy()
MAX = max(L)
L_copy.pop(L.index(MAX))


if MAX < sum(L_copy):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
H, W = map(int,input().split())
a = []
for i in range(H):
  a1 = input()
  if "#" in a1:
    a.append(a1)

b = []
for i in range(W):
  bi = [""] * W
  for j in range(len(a)):
    if j == len(a) - 1 and "#" in a[j - 2][i] + a[j - 1][i] + a[j][i]:
      b.append(a[j - 2][i] + a[j - 1][i] + a[j][i])
      
for i in range(len(b)):
  ans = 0
  for j in range(len(b[0])):
    ans = b[j - 2][i] + b[j - 1][i] + b[j][i]
  print(ans)
   

Fixed submission:
H, W = map(int,input().split())
a = []
for i in range(H):
  a1 = input()
  if "#" in a1:
    a.append(a1)

b = []
for i in range(W):
  for j in range(len(a)):
    if a[j][i] == "#":
      break
  else:
      b.append(i)

for i in range(len(a)):
  ans = ""
  for j in range(W):
    if not j in b:
      ans += a[i][j]
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int,input().split())
li = [i for i in range(A,B + 1)]
ans = set(li[:K] + sorted(li,reverse = True)[:K])
  
for i in sorted(ans):
  print(i)

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

ans = []
for i in range(K):
  if A + i <= B:
    ans.append(A + i)
  if B - i >= A:
    ans.append(B - i)

for i in sorted(set(ans)):
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int,input().split())
li = [i for i in range(A,B + 1)]
ans = set(li[:K] + sorted(li,reverse = True)[:K])
  
for i in sorted(ans):
  print(i)

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

ans = []
for i in range(K):
  if A + i <= B:
    ans.append(A + i)
  if B - i >= A:
    ans.append(B - i)

for i in sorted(set(ans)):
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int,input().split())
li = [i for i in range(A,B + 1)]
ans = sorted(list(set(li[:K] + sorted(li,reverse = True)[:K])))

for i in ans:
  print(i)

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

ans = []
for i in range(K):
  if A + i <= B:
    ans.append(A + i)
  if B - i >= A:
    ans.append(B - i)

for i in sorted(set(ans)):
  print(i)
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]

ans = 0
for i in a:
  ans = max(ans, s.count(i) - t.count(i))

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]
a = Counter(s)
a = a.most_common()


ans = 0
for i in a:
  if i[0] not in t:
    ans = max(i[1],ans)

  elif i[0] in t:
    ans = max(i[1] - t.count(i[0]),ans)


print(ans)
Buggy python submission (verdict: Runtime Error):
from functools import reduce

N = int(input())
mod = 10**9 + 7


def powmod(val, n, mod):
    # vals = [val]*n
    # ret = reduce(lambda x, y: x * y % mod, vals)

    # return ret

    for i in range(n):
        ret = ret * val % mod

    return ret


all = powmod(10, N, mod)
b = powmod(9, N, mod)
c = powmod(8, N, mod)

ans = (all - (2*b - c))%mod

print(ans)

Fixed submission:
N = int(input())
mod = 10**9 + 7


def powmod(val, n, mod):
    ret = 1
    for i in range(n):
        ret = ret * val % mod

    return ret


all = powmod(10, N, mod)
b = powmod(9, N, mod)
c = powmod(8, N, mod)

ans = (all - (2*b - c))%mod

print(ans)