Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
h, w, n = map(int,input().split())
cell = [[0]*w for _ in range(h)]
for _ in range(n):
    a, b = map(int,input().split())
    for i in range(3):
        for j in range(3):
            if a-i>=0 and b-j>=0:
                cell[a-i-1][b-j-1] += 1
            else:
                continue

ans = [0]*10

for i in range(h-2):
    for j in range(w-2):
        s = cell[i][j]
        ans[s] += 1

for i in ans:
    print(i)

Fixed submission:
h, w, n = map(int,input().split())
 
xy_pos = dict()
 
for i in range(n):
    a, b = map(int, input().split())
    for k in range(-2,1):
        for l in range(-2,1):
            x = (a-1) + k
            y = (b-1) + l
            if (0 <= x <= h-3 and 0 <= y <= w-3):
                xy = str(x) + "x" + str(y)
                if xy in xy_pos:
                    xy_pos[xy] += 1
                else:
                    xy_pos[xy] = 1
 
ans = [0]*10                    
for v in xy_pos.values():
    ans[v] += 1
ans[0] = (h-2)*(w-2) - sum(ans)
for i in range(10):
    print(ans[i])

Buggy python submission (verdict: Runtime Error):
h, w, n = map(int,input().split())
cell = [[0]*w for _ in range(h)]
for _ in range(n):
    a, b = map(int,input().split())
    cell[a-1][b-1] = 1

ans = [0]*10

for i in range(h-2):
    for j in range(w-2):
        s = [cell[i][j],cell[i+1][j],cell[i+2][j],cell[i][j+1],cell[i+1][j+1],cell[i+2][j+1],cell[i][j+2],cell[i+1][j+2],cell[i+2][j+2]].count(1)
        ans[s] += 1

for i in ans:
    print(i)

Fixed submission:
h, w, n = map(int,input().split())
 
xy_pos = dict()
 
for i in range(n):
    a, b = map(int, input().split())
    for k in range(-2,1):
        for l in range(-2,1):
            x = (a-1) + k
            y = (b-1) + l
            if (0 <= x <= h-3 and 0 <= y <= w-3):
                xy = str(x) + "x" + str(y)
                if xy in xy_pos:
                    xy_pos[xy] += 1
                else:
                    xy_pos[xy] = 1
 
ans = [0]*10                    
for v in xy_pos.values():
    ans[v] += 1
ans[0] = (h-2)*(w-2) - sum(ans)
for i in range(10):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
pairs = (map(int, input().split()) for _ in range(N))

t, a = 1, 1
for ti, ai in pairs:
    mul = 1
    while ti * mul < t or ai * mul < a:
        mul += 1
    t, a = ti * mul, ai * mul

print(t + a)

Fixed submission:
from decimal import Decimal, ROUND_CEILING

N = int(input())
pairs = (map(Decimal, input().split()) for _ in range(N))

t = Decimal('1')
a = Decimal('1')
ceil = lambda d: d.to_integral_exact(rounding=ROUND_CEILING)

for ti, ai in pairs:
    mul = max(ceil(t / ti), ceil(a / ai))
    t = ti * mul
    a = ai * mul

print(int(t + a))
Buggy python submission (verdict: Runtime Error):
N, _ = map(int, input().split())
values = [input() for _ in range(N)]
print(''.join(sorted(values)))

Fixed submission:
values = sorted(int(v) for v in input().split())
if values == [5, 5, 7]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
sample = input()
new = []
for i in sample:
  new.append(i)
if "A" in new:
  a_pos = list.index(new)
if "Z" in new:
  z_pos = list.index(new)
if a_post < z_pos:
  out = new[a_pos:(z_pos+1)]
    
new_string = ""
for j in out:
  new_string += j
print(len(new_string))


Fixed submission:
sample = input()
#new = list(sample)
#if "A" in new:
a_pos = sample.index('A')
#if "Z" in new:
z_pos = sample.rfind('Z')
print(z_pos-a_pos+1)

Buggy python submission (verdict: Runtime Error):
sample = input()
new = []
for i in sample:
  new.append(i)
if "A" in new:
  a_pos = list.index(new)
if "Z" in new:
  z_pos = list.index(new)
if a_post < z_pos:
  out = new[a_pos:(z_pos+1)]
    
new_string = ""
for i in out:
  new_string += i
print(len(new_string))


Fixed submission:
sample = input()
#new = list(sample)
#if "A" in new:
a_pos = sample.index('A')
#if "Z" in new:
z_pos = sample.rfind('Z')
print(z_pos-a_pos+1)

Buggy python submission (verdict: Runtime Error):
sample = input()
new = []
for i in sample:
  new.append(i)
if "A" in new:
  a_pos = list.index(new)
if "Z" in new:
  z_pos = list.index(new)
if a_post < z_pos:
	out = new[a_pos:(z_pos+1)]
    
new_string = ""
for i in out:
  new_string += i
print(len(new_string))


Fixed submission:
sample = input()
#new = list(sample)
#if "A" in new:
a_pos = sample.index('A')
#if "Z" in new:
z_pos = sample.rfind('Z')
print(z_pos-a_pos+1)

Buggy python submission (verdict: Runtime Error):
sample = input()
new = []
for i in sample:
  new.append(i)
if "A" in new:
  a_pos = list.index(new)
if "Z" in new:
  z_pos = list.index(new)
if a_post < z_pos:
	out = new[a_pos:(z_pos+1)]
    
new_string = ""
for i in out:
  new_string += i
print(new_string)


Fixed submission:
sample = input()
#new = list(sample)
#if "A" in new:
a_pos = sample.index('A')
#if "Z" in new:
z_pos = sample.rfind('Z')
print(z_pos-a_pos+1)

Buggy python submission (verdict: Runtime Error):
sample = input()
new = []
for i in sample:
  new.append(i)
if "A" in new:
  a_pos = list.index(new)
if "Z" in new:
  z_pos = list.index(new)
out = new[a_pos:(z_pos+1)]
print(out)


Fixed submission:
sample = input()
#new = list(sample)
#if "A" in new:
a_pos = sample.index('A')
#if "Z" in new:
z_pos = sample.rfind('Z')
print(z_pos-a_pos+1)

Buggy python submission (verdict: Runtime Error):
sample = input()
new = []
for i in sample:
  new.append(i)
if "A" in new:
  a_pos = list.index(new)
if "Z" in new:
  z_pos = list.index(new)
out = new[a_pos:z_pos +1]
print(out)

Fixed submission:
sample = input()
#new = list(sample)
#if "A" in new:
a_pos = sample.index('A')
#if "Z" in new:
z_pos = sample.rfind('Z')
print(z_pos-a_pos+1)
Buggy python submission (verdict: Runtime Error):
num = int(input())
given = input()
new = given.split()
x = 0
max = 0
for i in range(num):
  if new[i] == "D":
    x -= 1
  if new[i] == "I":
    x += 1
  if max < x:
    max = x
print(max)


Fixed submission:
num = int(input())
new = input()

x = 0
m = 0
for i in range(num):
  if new[i] == "D":
    x -= 1
  if new[i] == "I":
    x += 1
  if m < x:
    m = x
print(m)

Buggy python submission (verdict: Runtime Error):
num = int(input())
given = input()
new = given.split()
x = 0
max = 0
for i in range(num):
  if new[i] == "D":
    x -= 1
  elif new[i] == "I":
    x += 1
  if max < x:
    max = x
print(max)

Fixed submission:
num = int(input())
new = input()

x = 0
m = 0
for i in range(num):
  if new[i] == "D":
    x -= 1
  if new[i] == "I":
    x += 1
  if m < x:
    m = x
print(m)
Buggy python submission (verdict: Runtime Error):
num_prob = int(input())
prob = input()
new = prob.split()
sum = 0
num_drinks = int(input())
for j in new:
  sum += int(j)

for i in range(num_drinks):
  line = input()
  new_line = line.split()
  if new_line[1] != new[new_line[0]]:
    sum -= new[new_line[0]]
    sum += new_line[1]
  print(sum)
    


Fixed submission:
num_prob = int(input())
prob = input()
new = prob.split()
sum = 0

for j in new:
  sum += int(j)

  
num_drinks = int(input())
for i in range(num_drinks):
  line = input()
  new_line = line.split()
  if int(new_line[1]) != int(new[int(new_line[0])-1]):
    temp = sum - int(new[int(new_line[0])-1]) + int(new_line[1])
    print(temp)
  else:
    print(sum)

Buggy python submission (verdict: Runtime Error):
num_prob = int(input())
prob = input()
new = prob.split()
sum = 0
num_drinks = input()
for j in new:
  sum += j

for i in range(num_drinks):
  line = input()
  new_line = line.split()
  if new_line[1] != new[new_line[0]]:
    sum -= new[new_line[0]]
    sum += new_line[1]
  print(sum)
    


Fixed submission:
num_prob = int(input())
prob = input()
new = prob.split()
sum = 0

for j in new:
  sum += int(j)

  
num_drinks = int(input())
for i in range(num_drinks):
  line = input()
  new_line = line.split()
  if int(new_line[1]) != int(new[int(new_line[0])-1]):
    temp = sum - int(new[int(new_line[0])-1]) + int(new_line[1])
    print(temp)
  else:
    print(sum)

Buggy python submission (verdict: Runtime Error):
num_prob = int(input())
prob = input()
new = prob.split()
sum = 0
num_drinks = input()
for j in new:
  sum += j

for i in range(num_drinks):
  line = input()
  new_line = line.split()
  if new_line[1] != new[new_line[0]]:
    sum -= new[new_line[0]]
    sum += new_line[1]
    


Fixed submission:
num_prob = int(input())
prob = input()
new = prob.split()
sum = 0

for j in new:
  sum += int(j)

  
num_drinks = int(input())
for i in range(num_drinks):
  line = input()
  new_line = line.split()
  if int(new_line[1]) != int(new[int(new_line[0])-1]):
    temp = sum - int(new[int(new_line[0])-1]) + int(new_line[1])
    print(temp)
  else:
    print(sum)
Buggy python submission (verdict: Runtime Error):
sentence = input()
new_sent = sentence.split(" ")
acro = ""
for i in range(len(new_sent)):
  for j in range(new_sent[i]):
  	acro += new_sent[i][0]
print(acro)


Fixed submission:
sentence = input()
new_sent = sentence.split(" ")
acro = ""
for i in new_sent:
  acro += i[0]
print(acro)
Buggy python submission (verdict: Runtime Error):
sample = input()
sample_list = sample.split(" ")
count = 0
flag = 0
for i in range(len(sample_list)):
  for j in range(1, i):
    if sample_list[i] == sample_list[j]:
      flag = 1
    if flag == 0:
      count += 1
    flag = 0
  return count


Fixed submission:
sample = input()
sample_list = sample.split(" ")
count = 0
flag = 0
i = 0
j = 1
for i in range(len(sample_list)):
  for j in range(i):
    if sample_list[i] == sample_list[j]:
      flag = 1
  if flag == 0:
    count += 1
  flag = 0
print(count)

Buggy python submission (verdict: Runtime Error):
sample = input()
sample_list = sample.split(" ")
count = 0
flag = 0
for i in range(len(sample_list)):
  for j in range(1, i):
    if L1[i] == L1[j]:
      flag = 1
    if flag == 0:
      count += 1
    flag = 0
  return count

Fixed submission:
sample = input()
sample_list = sample.split(" ")
count = 0
flag = 0
i = 0
j = 1
for i in range(len(sample_list)):
  for j in range(i):
    if sample_list[i] == sample_list[j]:
      flag = 1
  if flag == 0:
    count += 1
  flag = 0
print(count)
Buggy python submission (verdict: Runtime Error):
sample = input() # two numbers in a string
new_sample = sample.split(" ")

ball = int(new_sample[0]) # number of balls
color = int(new_sample[1]) # number of colors
if color == 1 and ball > 1:
  print(0)
else:
	product = color


# for i in range(1, ball):
  for i in range(1, ball):
    product *= (color-1)
  print(product)

  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices


Fixed submission:
sample = input() # two numbers in a string
new_sample = sample.split(" ")

ball = int(new_sample[0]) # number of balls
color = int(new_sample[1]) # number of colors
if ball > 1 and color == 1:
  print(0)
else:
  product = color
  for i in range(1, ball):
    product *= (color-1)
  print(product)

  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices

Buggy python submission (verdict: Runtime Error):
sample = input() # two numbers in a string
new_sample = sample.split(" ")
ball = new_sample[0] # number of balls
color = new_sample[1] # number of colors
product = color


# for i in range(1, ball):
for i in range(1, ball):
  product *= product-1
print(product)
  
  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices


Fixed submission:
sample = input() # two numbers in a string
new_sample = sample.split(" ")

ball = int(new_sample[0]) # number of balls
color = int(new_sample[1]) # number of colors
if ball > 1 and color == 1:
  print(0)
else:
  product = color
  for i in range(1, ball):
    product *= (color-1)
  print(product)

  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices

Buggy python submission (verdict: Runtime Error):
sample = input() # two numbers in a string
new_sample = sample.split(" ")
ball = new_sample[0] # number of balls
color = new_sample[1] # number of colors
product = color

for i in range(1, ball+1):
  product *= color-1
print(product)
  
  
# 2 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices

Fixed submission:
sample = input() # two numbers in a string
new_sample = sample.split(" ")

ball = int(new_sample[0]) # number of balls
color = int(new_sample[1]) # number of colors
if ball > 1 and color == 1:
  print(0)
else:
  product = color
  for i in range(1, ball):
    product *= (color-1)
  print(product)

  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices

Buggy python submission (verdict: Runtime Error):
sample = input() # two numbers in a string
new_sample = sample.split(" ")
ball = new_sample[0]
color = new_sample[1]
product = color

for i in range(1, ball):
  product *= color-1
print(product)
  
  

Fixed submission:
sample = input() # two numbers in a string
new_sample = sample.split(" ")

ball = int(new_sample[0]) # number of balls
color = int(new_sample[1]) # number of colors
if ball > 1 and color == 1:
  print(0)
else:
  product = color
  for i in range(1, ball):
    product *= (color-1)
  print(product)

  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices
Buggy python submission (verdict: Runtime Error):
alice = input()
bob = input()
charlie = input()

for i in range(len(alice)):
  if alice[i] == "a":
    while alice[i] == "a":
    	alice.pop(i)
    
  elif alice[i] == "b":
    alice.pop(i)
    if bob[i] == "b":
      while bob[i] == "b":
      	bob.pop(i)
    elif bob[i] == "a":
      while bob[i] == "a":
        alice.pop(i)
    elif bob[i] == "c":
       while bob[i] == "c":
        charlie.pop(i)
      
  elif alice[i] == "c":
    alice.pop(i)
    if charlie[i] == "c":
      while charlie[i] == "c":
        charlie.pop(i)
    elif charlie[i] == "b":
      while charlie[i] == "b":
        bob.pop(i)
    elif charlie[i] == "a":
      while charlie[i] == "a":
        alice.pop(i)

for i in range(len(alice)):
	if len(alice) == 0 and alice[ 

Fixed submission:
a = list(input())
b = list(input())
c = list(input())

win = False # if win == True, someone will win
run = a

while win != True:
  if run[0] == "a":
    run.pop(0)
    run = a # reset run
    if len(a) == 0:
      print("A")
      win = True
  elif run[0] == "b":
    run.pop(0)
    run = b
    if len(b) == 0:
      print("B")
      win = True
  else:
    run.pop(0)
    run = c
    if len(c) == 0:
      print("C")
      win = True
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())

print((a+b)*h/2)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
 
print(int(a+b)*h//2 )
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
cnt=0
i=0
while x>0:
    if cnt%2 == 0:
        x -= 6
        cnt += 1
    else:
        x -= 5
        cnt += 1
print(cnt)

Fixed submission:
x=int(input())
a=(x//11)*2
if x%11 == 0:
    b=0
elif x%11 <= 6:
    b=1
else:
    b=2
print(a+b)

Buggy python submission (verdict: Runtime Error):
# 整数の入力
x = int(raw_input())
 
a = x // 11
 
if  x % 11  < 6:
    
      print 2*a +1 
else :
      print 2*a +2 

Fixed submission:
x = int(raw_input())
 
a = x // 11
 
if   0 <  x % 11  <= 6:
    
      print 2*a +1
 
elif x%11==0 :
      print 2*a
else :
      print 2*a +2

Buggy python submission (verdict: Runtime Error):
# 整数の入力
x = int(raw_input())
 
a = x // 11
 
if  x % 11  < 6:
    
      print 2*a +1 
else :
      print 2*a +2 

Fixed submission:
x = int(raw_input())
 
a = x // 11
 
if   0 <  x % 11  <= 6:
    
      print 2*a +1
 
elif x%11==0 :
      print 2*a
else :
      print 2*a +2

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 整数の入力
x = int(raw_input())

a = [6,5]*(x/6)
i=0

while x - sum(a[0:i]) > 0 :
    
    i +=1

print i

Fixed submission:
x = int(raw_input())
 
a = x // 11
 
if   0 <  x % 11  <= 6:
    
      print 2*a +1
 
elif x%11==0 :
      print 2*a
else :
      print 2*a +2

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 整数の入力
x = int(raw_input())

a = [6,5]*(x/6)
i=0

while x - sum(a[0:i]) > 0 :
    
    i +=1

print i

Fixed submission:
x = int(raw_input())
 
a = x // 11
 
if   0 <  x % 11  <= 6:
    
      print 2*a +1
 
elif x%11==0 :
      print 2*a
else :
      print 2*a +2
Buggy python submission (verdict: Runtime Error):
s = input()

s_long = len(s)
first_a_adress = -1
end_z_adress = -1
for var in range(0,s_long):
	if s[var] == 'a':
		first_a_adress = var
		break
				
for var in reversed(range(0,s_long)):
	if s[var] == 'z':
		end_z_adress = var
		break
print end_z_adress - first_a_adress + 1

Fixed submission:
s = raw_input()

s_long = len(s)
first_a_adress = -1
end_z_adress = -1
for var in range(0,s_long):
	if s[var] == 'A':
		first_a_adress = var
		break
				
for var in reversed(range(0,s_long)):
	if s[var] == 'Z':
		end_z_adress = var
		break
print end_z_adress - first_a_adress + 1
Buggy python submission (verdict: Time Limit Exceeded):
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 z in range(k + 1):
            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 z in range(k + 1):
            ans += 1

print(ans)
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):
L,N = map(int,input().split())
S = []
for _ in range(N):
    S.append(str(input()))
S.sort()
print(''.join(S))

Fixed submission:
N,L = map(int,input().split())
list1 = []
for l in range(N):
    list1.append(str(input()))
list1.sort()
print(''.join(list1))

Buggy python submission (verdict: Runtime Error):
L,N = map(int,input().split())
list1 = []
for l in range(N):
    list1.append(str(input()))
list1.sort()
print(''.join(list1))

Fixed submission:
N,L = map(int,input().split())
list1 = []
for l in range(N):
    list1.append(str(input()))
list1.sort()
print(''.join(list1))

Buggy python submission (verdict: Runtime Error):
L,N = map(int,input().split())
list1 = []
for _ in range(N):
    list1.append(str(input()))
list1.sort()
print(''.join(list1))

Fixed submission:
N,L = map(int,input().split())
list1 = []
for l in range(N):
    list1.append(str(input()))
list1.sort()
print(''.join(list1))

Buggy python submission (verdict: Runtime Error):
L,N = map(int,input().split())
list1 = []
for _ in range(N):
    list1.append(input())
list1.sort()
print(''.join(list1))

Fixed submission:
N,L = map(int,input().split())
list1 = []
for l in range(N):
    list1.append(str(input()))
list1.sort()
print(''.join(list1))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, raw_input().split())


Fixed submission:
a, b, c = map(int, raw_input().split())
print(len(set([a,b,c])))

Buggy python submission (verdict: Runtime Error):
n, k = map(int, raw_input().split())
print(k * (k-1)**(n-1))

Fixed submission:
a, b, c = map(int, raw_input().split())
print(len(set([a,b,c])))

Buggy python submission (verdict: Runtime Error):
n, k = map(int, raw_input().split())
print(k * (k-1)**(n-1))


Fixed submission:
a, b, c = map(int, raw_input().split())
print(len(set([a,b,c])))

Buggy python submission (verdict: Runtime Error):
n, k = map(int, raw_input().split())
print(k * (k-1)**(n-1))

Fixed submission:
a, b, c = map(int, raw_input().split())
print(len(set([a,b,c])))

Buggy python submission (verdict: Runtime Error):
n, k = map(int, raw_input().split())
print(k * (k-1)**(n-1))

Fixed submission:
a, b, c = map(int, raw_input().split())
print(len(set([a,b,c])))

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, raw_input())
print(len(set([a,b,c])))

Fixed submission:
a, b, c = map(int, raw_input().split())
print(len(set([a,b,c])))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
X = [map(int, raw_input().split()) for i in range(N)]

def update(n, x):
    t, a = x
    n1, n2 = n
    c = 1
    for i in xrange(10**18):
        if i * t >= n1 and i * a >=n2:
            c = i
            break
    return c * t, c* a

n = (1, 1)
for x in X:
    n = update(n, x)
print(sum(n))


Fixed submission:
N = int(raw_input())
X = [map(int, raw_input().split()) for i in range(N)]

def update(n, x):
    t, a = x
    n1, n2 = n
    c = 1
    i0 = max(n1/t, n2/a)
    for i in xrange(i0, 10**18):
        if i * t >= n1 and i * a >=n2:
            c = i
            break
    return c * t, c* a

n = (1, 1)
for x in X:
    n = update(n, x)
print(sum(n))
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
s = str(raw_input())
x = 0
xs = [x]
for si in s:
    if si == 'I': x += 1
    else: x -= 1
    xs.append(x)
print max(xs)

Fixed submission:
a, b, c, d = map(int, raw_input().split())
print a*b if a*b > c*d else c*d

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, raw_input().split())
print(a*b if a*b > c*d else c*d)

Fixed submission:
a, b, c, d = map(int, raw_input().split())
print a*b if a*b > c*d else c*d
Buggy python submission (verdict: Runtime Error):
def main():
    sx,sy,tx,ty = map(int,input().split())

    root = ""

    # first
    for n in range(tx - sx):
        root += "R"
    for n in range(ty - sy):
        root += "U"

    # first back
    for n in range(tx - sx):
        root += "L"
    for n in range(ty - sy):
        root += "D"

    # first
    root += "D"
    for n in range(tx - sx + 1):
        root += "R"
    for n in range(ty - sy + 1):
        root += "U"
    root += "L"

    # first back
    root += "U"
    for n in range(tx - sx + 1):
        root += "L"
    for n in range(ty - sy + 1):
        root += "D"
    root += "R"

    print(root)

if __name__ == "__main__":
    main()


Fixed submission:
def main():
    s = input().split(',')
    s = ' '.join(s)
    print(s)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    K,S = map(int,input().split())

    count = 0
    for x in range(K + 1):
        for y in range(K + 1):
            for z in range(K + 1):
                if x + y + z == S:
                    count += 1
    print(count)

if __name__ == "__main__":
    main()


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

    count = 0
    for x in range(max(0,S - 2*K), K + 1):
        for y in range(max(0,S - x - K), K + 1):
            if 0 <= S - x - y <= K:
                count += 1
    print(count)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
N = input()
K = input()
X = input()
Y = input()

if N > K:
    res = K*X + (N-K)*Y 
else
    res = N*X

print(res)


Fixed submission:
N = input()
K = input()
X = input()
Y = input()

if N > K:
    res = K*X + (N-K)*Y 
else:
    res = N*X

print(res)
Buggy python submission (verdict: Runtime Error):
[a, b] = map(int, input().split())
if a*3==b:
    print(1)
elif b%3==0:
    print(b*3+1)
else:
    print(b*3)


Fixed submission:
s = str(input())
s = s[:5] + " " + s[6:13] + " " + s[14:]
print(s)