Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

h,w=mp()
s=["#"*(w+2)]
for i in range(h):
    s.append("#"+input()+"#")
s.append("#"*(w+2))
ans=[[0]*(w+2) for i in range(h+2)]

for i in range(h+2):
    ran=[]
    c=1
    for j in range(1,w+2):
        if s[i][j]==s[i][j-1]:
            c+=1
        else:
            ran.append(c)
            c=1
    ran.append(c)
    p=0
    for j in range(len(ran)):
        for k in range(ran[j]):
            if j%2==1:
                ans[i][p]+=ran[j]
            p+=1

for i in range(w+2):
    ran=[]
    c=1
    for j in range(1,h+2):
        if s[j][i]==s[j-1][i]:
            c+=1
        else:
            ran.append(c)
            c=1
    ran.append(c)
    p=0
    for j in range(len(ran)):
        for k in range(ran[j]):
            if j%2==1:
                ans[p][i]+=ran[j]
            p+=1
print(max(sum(ans,[]))-1)

Fixed submission:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

h,w=mp()
s=["#"*(w+2)]
for i in range(h):
    s.append("#"+input()+"#")
s.append("#"*(w+2))
ans=[[0]*(w+2) for i in range(h+2)]

for i in range(h+2):
    ran=[]
    c=1
    for j in range(1,w+2):
        if s[i][j]==s[i][j-1]:
            c+=1
        else:
            ran.append(c)
            c=1
    ran.append(c)
    p=0
    for j in range(len(ran)):
        for k in range(ran[j]):
            if j%2==1:
                ans[i][p]+=ran[j]
            p+=1

for i in range(w+2):
    ran=[]
    c=1
    for j in range(1,h+2):
        if s[j][i]==s[j-1][i]:
            c+=1
        else:
            ran.append(c)
            c=1
    ran.append(c)
    p=0
    for j in range(len(ran)):
        for k in range(ran[j]):
            if j%2==1:
                ans[p][i]+=ran[j]
            p+=1
print(max(list(itertools.chain.from_iterable(ans)))-1)
Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,a,b,c,d=mp()
s=input()
if s[a-1]=="#" or s[b-1]=="#" or s[c-1]=="#" or s[d-1]=="#":
    print("No")
    exit()
for i in range(min(a,b)-1,max(c,d)):
    if s[i]=="#" and s[i+1]=="#":
        print("No")
        exit()
if d<c:
    ch=False
    for i in range(b-1,d):
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            ch=True
    if ch:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
else:
    print("Yes")

Fixed submission:
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,a,b,c,d=mp()
s=input()
if s[a-1]=="#" or s[b-1]=="#" or s[c-1]=="#" or s[d-1]=="#":
    print("No")
    exit()
for i in range(min(a,b)-1,max(c,d)):
    if s[i]=="#" and s[i+1]=="#":
        print("No")
        exit()
if d<c:
    ch=False
    for i in range(b-2,d-1):
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            ch=True
    if ch:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
a,p=mp()
print((a*3+p)//2)

Fixed submission:
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

a,p=mp()
print((a*3+p)//2)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
l=[list(map(int,input().split())) for i in range(m)]
l.sort(key=lambda x: x[1], reverse=True)
l=np.array(l)


nl=[]
k=0
i=0
while k<=n and i<m:
  nl.extend([l[i][1]]*l[i][0])
  k+=l[i][0]
  i+=1


for i in range(min(n,np.sum(l, axis=0)[0])):
  if nl[i]<=a[i]:
    print(sum(nl[0:i])+sum(a[i:n]))
    exit()
if n<np.sum(l, axis=0)[0]:
  print(sum(nl[0:n]))
else:
  print(sum(nl)+sum(a[np.sum(l, axis=0)[0]:n]))

Fixed submission:
import numpy as np
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
l=[list(map(int,input().split())) for i in range(m)]
l.sort(key=lambda x: x[1], reverse=True)
l=np.array(l)


nl=[]
k=0
i=0
while k<=n and i<m:
  nl.extend([l[i][1]]*l[i][0])
  k+=l[i][0]
  i+=1


for i in range(min(n,np.sum(l, axis=0)[0])):
  if nl[i]<=a[i]:
    print(sum(nl[0:i])+sum(a[i:n]))
    exit()
if n<np.sum(l, axis=0)[0]:
  print(sum(nl[0:n]))
else:
  print(sum(nl)+sum(a[np.sum(l, axis=0)[0]:n]))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
l=[list(map(int,input().split())) for i in range(m)]
l.sort(key=lambda x: x[1], reverse=True)
l=np.array(l)


nl=[]
for i in range(m):
  nl.extend([l[i][1]]*l[i][0])


for i in range(min(n,np.sum(l, axis=0)[0])):
  if nl[i]<=a[i]:
    print(sum(nl[0:i])+sum(a[i:n]))
    exit()
if n<np.sum(l, axis=0)[0]:
  print(sum(nl[0:n]))
else:
  print(sum(nl)+sum(a[np.sum(l, axis=0)[0]:n]))

Fixed submission:
import numpy as np
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())))
l=[list(map(int,input().split())) for i in range(m)]
l.sort(key=lambda x: x[1], reverse=True)
l=np.array(l)


nl=[]
k=0
i=0
while k<=n and i<m:
  nl.extend([l[i][1]]*l[i][0])
  k+=l[i][0]
  i+=1


for i in range(min(n,np.sum(l, axis=0)[0])):
  if nl[i]<=a[i]:
    print(sum(nl[0:i])+sum(a[i:n]))
    exit()
if n<np.sum(l, axis=0)[0]:
  print(sum(nl[0:n]))
else:
  print(sum(nl)+sum(a[np.sum(l, axis=0)[0]:n]))
Buggy python submission (verdict: Runtime Error):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

s=int(input())
a=s//100
b=s%100
if (a==0 or a>12) and (b==0 or b>12):
    print("Na")
elif (a==0 or a>12):
    print("YYMM")
elif (b==0 or b>12):
    p12rint("MMYY")
else:
    print("AMBIGUOUS")

Fixed submission:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

s=int(input())
a=s//100
b=s%100
if 0<a<13:
    if 0<b<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 0<b<13:
        print("YYMM")
    else:
        print("NA")
Buggy python submission (verdict: Runtime Error):
import bisect
n=int(input())
a=sorted(list(map(int,input().split())))
ind=bisect.bisect_left(a,0)


if ind==0 :
  print(sum(a))
  
elif ind==n:
  if ind%2==1:
    print(-sum(a)+2*a[-1])
  else:
    print(abs(sum(a))

elif ind%2==0:

  print(-sum(a[:ind])+sum(a[ind:]))
else:
  print(-sum(a[:ind])+sum(a[ind:])-2*min(abs(a[ind]),abs(a[ind-1])))

Fixed submission:
import bisect
n=int(input())
a=sorted(list(map(int,input().split())))
ind=bisect.bisect_left(a,0)


if ind==0 :
  print(sum(a))
  
elif ind==n:
  if ind%2==1:
    print(-sum(a)+2*a[-1])
  else:
    print(abs(sum(a)))

elif ind%2==0:

  print(-sum(a[:ind])+sum(a[ind:]))
else:
  print(-sum(a[:ind])+sum(a[ind:])-2*min(abs(a[ind]),abs(a[ind-1])))

Buggy python submission (verdict: Runtime Error):
import bisect
n=int(input())
a=sorted(list(map(int,input().split())))
ind=bisect.bisect_left(a,0)
print(ind)

if ind==0:
  print(sum(a))

elif ind%2==0 or a[ind]==0:

  print(-sum(a[:ind])+sum(a[ind:]))
else:
  print(-sum(a[:ind])+sum(a[ind:])-2*min(abs(a[ind]),abs(a[ind-1])))

Fixed submission:
import bisect
n=int(input())
a=sorted(list(map(int,input().split())))
ind=bisect.bisect_left(a,0)


if ind==0 :
  print(sum(a))
  
elif ind==n:
  if ind%2==1:
    print(-sum(a)+2*a[-1])
  else:
    print(abs(sum(a)))

elif ind%2==0:

  print(-sum(a[:ind])+sum(a[ind:]))
else:
  print(-sum(a[:ind])+sum(a[ind:])-2*min(abs(a[ind]),abs(a[ind-1])))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=sorted(list(map(int,input().split())))
ans=sum(a)
for i in range(n//2):
  a[i*2]*=-1
  a[i*2+1]*=-1
  ans=max(ans,sum(a))
print(ans)

Fixed submission:
import bisect
n=int(input())
a=sorted(list(map(int,input().split())))
ind=bisect.bisect_left(a,0)


if ind==0 :
  print(sum(a))
  
elif ind==n:
  if ind%2==1:
    print(-sum(a)+2*a[-1])
  else:
    print(abs(sum(a)))

elif ind%2==0:

  print(-sum(a[:ind])+sum(a[ind:]))
else:
  print(-sum(a[:ind])+sum(a[ind:])-2*min(abs(a[ind]),abs(a[ind-1])))
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
for i in range(n):
  if l[n]*2 <=sum(l):
    print("No")
    exit()
print("Yes")

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

if max(l)*2 >=sum(l):
  print("No")
  exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
n=sorted(list(map(int,input().split())))
if n=[1,4,7,9]:
  print("YES")
else:
  print("NO")

Fixed submission:
n=sorted(list(map(int,input().split())))
if n==[1,4,7,9]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,w=mp()
item=[lmp() for i in range(n)]
dp=[[0]*(w+1) for i in range(n+1)]
for i in range(n):
    for k in range(1,w+1):
        if k<item[i][0]:
            dp[i+1][k]=dp[i][k]
        else:
            dp[i+1][k]=max(dp[i][k],dp[i][k-item[i][0]]+item[i][1])
print(dp[-1][-1])

Fixed submission:
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,w=mp()
dp=[0]*(w+1)
for i in range(n):
    x,y=mp()
    for k in range(w,x-1,-1):
        dp[k]=max(dp[k],dp[k-x]+y)
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=[input() for _ in range(n)]
h=sorted(h)
l=[]
for i in range(n-k+1):
  l.append(h[i+k-1]-h[i])
print(min(l))

Fixed submission:
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h=sorted(h)
l=[]
for i in range(n-k+1):
  l.append(h[i+k-1]-h[i])
print(min(l))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
from collections import deque
import math
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,m,Q=mp()
grid=[[0]*(n+1) for i in range(n+1)]
for i in range(m):
    l,r=mp()
    for j in range(1,l+1):
        for k in range(r,n+1):
            grid[j][k]+=1
for i in range(Q):
    p,q=mp()
    print(grid[p][q])



Fixed submission:
import sys
from collections import Counter
from collections import deque
import math
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,m,Q=mp()
grid=[[0]*(n+1) for i in range(n+1)]
for i in range(m):
    l,r=mp()
    for k in range(1,l+1):
        grid[k][r]+=1

for i in range(n):
    for k in range(n):
        grid[i][k+1]+=grid[i][k]



for i in range(Q):
    p,q=mp()
    print(grid[p][q])
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=sorted(map(iny,input().split()))
m=l.pop(0)
M=l.pop(n-2)
print(M-m)

Fixed submission:
n=int(input())
a=sorted(list(map(int,input().split())))
print(a[-1]-a[0])
Buggy python submission (verdict: Runtime Error):
n=input()
print("Yes" if int(n)%sum(map(int,n)==0 else "No")

Fixed submission:
n=input()
print("Yes" if int(n)%sum(map(int,n))==0 else "No")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split)
print("Yay!" if (a<=8 and b<=8) else ":(")

Fixed submission:
a,b=map(int,input().split())
print("Yay!" if a<=8 and b<=8 else ":(")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split)
print("Yay!" if a<=8 and b<=8 else ":(")

Fixed submission:
a,b=map(int,input().split())
print("Yay!" if a<=8 and b<=8 else ":(")
Buggy python submission (verdict: Runtime Error):
x=int(input())
l=[1]
for i in range(2,32):
  k=2
  while i**k<1000:
    l.append(i**k)
    k+=1
l=sorted(l)
for i in range(len(l)):
  if l[i]<=x<l[i+1]:
    print(l[i])
    exit()
print(961)

Fixed submission:
x=int(input())
if x==1000:
  print(1000)
  exit()
l=[1]
for i in range(2,32):
  k=2
  while i**k<=1000:
    l.append(i**k)
    k+=1
l=sorted(l)
for i in range(len(l)-1):
  if l[i]<=x<l[i+1]:
    print(l[i])
    exit()
print(961)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

N=int(input())
for h in range(1,3501):
    for n in range(h,3501):
        if (4*h*n-N*n-N*h)!=0:
            if (N*h*n)%(4*h*n-N*n-N*h)==0 and (N*h*n)//(4*h*n-N*n-N*h)>0:
                print(h,n,(N*h*n)//(4*h*n-N*n-N*h))
                exit()

Fixed submission:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

N=int(input())
for h in range(1,3501):
    for n in range(h,3501):
        if (4*h*n-N*n-N*h)!=0:
            if (N*h*n)%(4*h*n-N*n-N*h)==0 and (N*h*n)//(4*h*n-N*n-N*h)>0:
                print(h,n,(N*h*n)//(4*h*n-N*n-N*h))
                exit()
Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=sorted(lmp(),reverse=True)
i=0
l=[]
while i<n:
    if a[i]==a[i+1]:
        l.append(a[i])
        i+=1
    i+=1
if len(l)>=2:
    print(l[0]*l[1])
else:
    print(0)

Fixed submission:
import sys
from collections import Counter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=sorted(lmp(),reverse=True)
i=0
l=[]
while i<n-1:
    if a[i]==a[i+1]:
        l.append(a[i])
        i+=1
    i+=1
if len(l)>=2:
    print(l[0]*l[1])
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
tree=[[] for i in range(n+1)]
for i in range(n-1):
    a,b,c=mp()
    tree[a].append((b,c))
    tree[b].append((a,c))
q,k=mp()
dist=[-1]*(n+1)
dist[k]=0
deq=deque()
deq.append(k)

while len(list(deq))>0:
    p=deq.popleft()
    for x,y in tree[p]:
        if dist[x]==-1:
            dist[x]=dist[p]+y
            deq.append(x)
for i in range(q):
    xi,yi=mp()
    print(dist[xi]+dist[yi])

Fixed submission:
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
tree=[[] for i in range(n+1)]
for i in range(n-1):
    a,b,c=mp()
    tree[a].append((b,c))
    tree[b].append((a,c))
q,k=mp()
dist=[-1]*(n+1)
dist[k]=0
deq=deque()
deq.append(k)

while len(deq):
    p=deq.popleft()
    for x,y in tree[p]:
        if dist[x]==-1:
            dist[x]=dist[p]+y
            deq.append(x)
for i in range(q):
    xi,yi=mp()
    print(dist[xi]+dist[yi])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
tree=[[] for i in range(n+1)]
for i in range(n-1):
    a,b,c=mp()
    tree[a].append((b,c))
    tree[b].append((a,c))
q,k=mp()
dist=[-1]*(n+1)
dist[k]=0
deq=deque()
deq.append(k)

while len(list(deq))>0:
    p=deq.popleft()
    for x,y in tree[p]:
        if dist[x]==-1:
            dist[x]=dist[p]+y
            deq.append(x)
for i in range(q):
    xi,yi=mp()
    print(dist[xi]+dist[yi])

Fixed submission:
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
tree=[[] for i in range(n+1)]
for i in range(n-1):
    a,b,c=mp()
    tree[a].append((b,c))
    tree[b].append((a,c))
q,k=mp()
dist=[-1]*(n+1)
dist[k]=0
deq=deque()
deq.append(k)

while len(deq):
    p=deq.popleft()
    for x,y in tree[p]:
        if dist[x]==-1:
            dist[x]=dist[p]+y
            deq.append(x)
for i in range(q):
    xi,yi=mp()
    print(dist[xi]+dist[yi])
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().sprit())
print((a-1)*(b-1))

Fixed submission:
a,b=map(int,input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
import math
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
if k>max(a):
    print("IMPOSSIBLE")
    exit()
g=a[0]
for i in range(1,n):
    g=math.gcd(g,a[i])
for i in range(n):
    a[i]=a[i]%g
if k%g in a:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Fixed submission:
import fractions
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
b=[0]*n
if k>max(a):
    print("IMPOSSIBLE")
    exit()
g=a[0]
for i in range(1,n):
    g=fractions.gcd(g,a[i])
for i in range(n):
    b[i]=a[i]%g
if k%g in b:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
import math
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
b=[0]*n
if k>max(a):
    print("IMPOSSIBLE")
    exit()
g=a[0]
for i in range(1,n):
    g=math.gcd(g,a[i])
for i in range(n):
    b[i]=a[i]%g
if k%g in b:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Fixed submission:
import fractions
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
b=[0]*n
if k>max(a):
    print("IMPOSSIBLE")
    exit()
g=a[0]
for i in range(1,n):
    g=fractions.gcd(g,a[i])
for i in range(n):
    b[i]=a[i]%g
if k%g in b:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,a,b=mp()
print(max((b-a)*(n-2)+1),0)

Fixed submission:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,a,b=mp()
print(max(((b-a)*(n-2)+1),0))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

mod=1000000007
n=int(input())
ans=1
for i in range(1,n+1):
    ans*=i%mod
print(ans%mod)

Fixed submission:
import math
n=int(input())
print(math.factorial(n)%1000000007)

Buggy python submission (verdict: Runtime Error):
import math
a=int(input())
print(math.factorial(n)%(10**9+7))

Fixed submission:
import math
n=int(input())
print(math.factorial(n)%1000000007)

Buggy python submission (verdict: Runtime Error):
import math
a=int(input())
print(math.factorial(n)%(10**9+7))

Fixed submission:
import math
n=int(input())
print(math.factorial(n)%1000000007)

Buggy python submission (verdict: Runtime Error):
a=int(input())
import math
print(math.factorial(n)%(10**9+7))

Fixed submission:
import math
n=int(input())
print(math.factorial(n)%1000000007)

Buggy python submission (verdict: Runtime Error):
a=input()
import math
print(math.factorial(n)%(10**9+7))

Fixed submission:
import math
n=int(input())
print(math.factorial(n)%1000000007)
Buggy python submission (verdict: Runtime Error):
sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy
print("U"*y+"R"*x+"D"*y+"L"*(x+1)+"U"*(y+1)+"R"*(x+1)+"DR"+"D"*(y+1)+"L"*(x+1)+"U"

Fixed submission:
sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy
print("U"*y+"R"*x+"D"*y+"L"*(x+1)+"U"*(y+1)+"R"*(x+1)+"DR"+"D"*(y+1)+"L"*(x+1)+"U")
Buggy python submission (verdict: Runtime Error):
s=input()
n=s.count("N")
w=s.count("W")
s=s.count("S")
e=s.count("E")
ns=n+s
we=w+e
if n>0 and w>0 and s>0 and e>0:
  print("Yes")
elif n>0 and w>0 and we==0:
  print("Yes")
elif ns==0 and s>0 and e>0:
  print("Yes")
else print("No")

Fixed submission:
i=set(input())
if i=={"E","N","S","W"} or i=={"N","S"} or i=={"E","W"}:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=int(imput())
print(n*(n+1)//2)

Fixed submission:
n=int(input())
print(n*(n+1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input())
ans = 0
for i in range(1,n):
    tmpans = 0
    streak = 0
    for j in range(n-i):
        if s[j] == s[j+i]:
            streak += 1
        else:
            tmpans = max(tmpans,min(i,streak))
            streak = 0
    tmpans = max(tmpans,min(i,streak))
    ans = max(tmpans,ans)
print(ans)


Fixed submission:
n = int(input())
s = list(input())
ans = 0
for i in range(1,n):
    tmpans = 0
    streak = 0
    for j in range(n-i):
        if s[j] == s[j+i]:
            streak += 1
        else:
            tmpans = max(tmpans,min(i,streak))
            streak = 0
    tmpans = max(tmpans,min(i,streak))
    ans = max(tmpans,ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())
ans = 0
for i in range(1,n):
    tmpans = 0
    streak = 0
    for j in range(n-i):
        #print(s[j],s[j+i])
        if s[j] == s[j+i]:
            streak += 1
        else:
            tmpans = max(tmpans,min(i,streak))
            streak = 0
    ans = max(tmpans,ans)
if len(ansl) > 0:
    print(ans)


Fixed submission:
n = int(input())
s = list(input())
ans = 0
for i in range(1,n):
    tmpans = 0
    streak = 0
    for j in range(n-i):
        if s[j] == s[j+i]:
            streak += 1
        else:
            tmpans = max(tmpans,min(i,streak))
            streak = 0
    tmpans = max(tmpans,min(i,streak))
    ans = max(tmpans,ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = int(inpupt().split())
if((a-b)<c):
  print(c-(a-b))
else:
  print(0)


Fixed submission:
a,b,c = map(int,input().split());
if((a-b)<c):
  print(c-(a-b))
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
a,b,c = int(input());
if((a-b)<c):
  print(c-(a-b))
else:
  print(0)

Fixed submission:
a,b,c = map(int,input().split());
if((a-b)<c):
  print(c-(a-b))
else:
  print(0)