Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    a = [str(i) for i in input().split()]
    b = int(a[0])
    c = int(a[1].replace(".",""))
    d = Decimal(a[0]) * Decimal(c) / Decimal(100)
    e = int(d)
    print(e)


Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    a = [str(i) for i in input().split()]
    b = int(a[0])
    c = int(a[1].replace(".",""))
    d = Decimal(a[0]) * Decimal(c) / Decimal(100)
    e = int(d)
    print(e)

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    a = [float(i) for i in input().split()]
    b= int(a[0])
    c = int(a[1]*100)
    d = Decimal(a[0]) * Decimal(c) / Decimal(100)
    e = int(d)
    print(e)



Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    a = [str(i) for i in input().split()]
    b = int(a[0])
    c = int(a[1].replace(".",""))
    d = Decimal(a[0]) * Decimal(c) / Decimal(100)
    e = int(d)
    print(e)

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    a = [float(i) for i in input().split()]
    b= int(a[0])
    c = int(a[1]*100)
    d = Decimal(a[0]) * Decimal(a[1])
    e = int(d)
    print(e)



Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    a = [str(i) for i in input().split()]
    b = int(a[0])
    c = int(a[1].replace(".",""))
    d = Decimal(a[0]) * Decimal(c) / Decimal(100)
    e = int(d)
    print(e)
Buggy python submission (verdict: Runtime Error):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

def rootCheck(checkList):
    nextList=[]
    for i in checkList:
        for j in root[i]:
            if hint[j] == -1:
                hint[j] = i
                nextList.append(j)
    if len(nextList) >0:
        rootCheck(nextList)



if __name__ == '__main__':
    n, m = map(int, input().split())
    root = {}
    for i in range(m):
        b, c = map(int, input().split())
        if b-1 in root:
            root[b-1].append(c-1)
        else:
            root[b-1]=[c-1]
        if c-1 in root:
            root[c-1].append(b-1)
        else:
            root[c-1]=[b-1]
 
    hint =[-1]*n

    rootCheck(root[0])

    if -1 in hint:
        print("No")
    else:
        print("Yes")
        for i in hint[1:]:
            print(i+1)




Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

def rootCheck(checkList):
    nextList=[]
    for i in checkList:
        for j in root[i]:
            if hint[j] == -1:
                hint[j] = i
                nextList.append(j)
    if len(nextList) >0:
        rootCheck(nextList)



if __name__ == '__main__':
    sys.setrecursionlimit(10 ** 6)
    n, m = map(int, input().split())
    root = {}
    for i in range(m):
        b, c = map(int, input().split())
        if b-1 in root:
            root[b-1].append(c-1)
        else:
            root[b-1]=[c-1]
        if c-1 in root:
            root[c-1].append(b-1)
        else:
            root[c-1]=[b-1]
    hint =[-1]*n

    for i in root[0]:
        if hint[i] == -1:
            hint[i] = 0


    rootCheck(root[0])

    if -1 in hint:
        print("No")
    else:
        print("Yes")
        for i in hint[1:]:
            print(i+1)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    a = int(input())
    ansdict= {}
    count = 100000
    mcount =100000 *-1

    for i in range(0,100000):
        c = i **5
        ansdict[i]=c
        ansdict[i*-1]=c*-1
    flag = 0

    for i in range(mcount,count):
        for j in range(mcount,count):
            ans = ansdict[j]-ansdict[i]
            if ans ==a:
                print(str(j) + " " +str(i))
                flag+=1
                break
        if flag == 1:
            break


Fixed submission:
if __name__ == '__main__':
    a = int(input())
    ansdict= {}
    count = 1000
    mcount =1000 *(-1)

    for i in range(0,1000):
        c = i **5
        ansdict[i]=c
        ansdict[i*(-1)]=c*(-1)
    flag = 0

    for i in range(mcount+1,count):
        for j in range(mcount+1,count):
            ans = ansdict[j]-ansdict[i]
            if ans ==a:
                print(str(j) + " " +str(i))
                flag+=1
                break
        if flag == 1:
            break
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
if __name__ == '__main__':
    a = int(input())

    count = 0

    for i in range(1,a+1):
        for j in range(1, a + 1):
            for k in range(1, a + 1):
                count += gcd(i,j,k)

    print(count)

Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *
 
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
if __name__ == '__main__':
    a = int(input())
 
    count = 0
 
    for i in range(1,a+1):
        for j in range(1, a + 1):
            for k in range(1, a + 1):
                count += gcd(i,j,k)
 
    print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    n,x,y = map(int, input().split())
    costList = [0]*n

    for i in range(1, n):
        for j in range(i+1, n+1):
            if j > i:
                minCost = min(abs(i-j),abs( x-i) +abs(y-j)+1,abs( y-i) +abs(x-j)+1 )
                costList[minCost] = costList[minCost]+1


    for i in range(n):
        if i >0:
            print(costList[i])

Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    n,x,y = map(int, input().split())
    costList = [0]*n

    for i in range(1, n):
        for j in range(i+1, n+1):
            if j > i:
                minCost = min(abs(i-j),abs( x-i) +abs(y-j)+1,abs( y-i) +abs(x-j)+1 )
                costList[minCost] +=1


    for i in range(n):
        if i >0:
            print(costList[i])

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    n,x,y = map(int, input().split())
    costList = [0]*n

    for i in range(n):
        for j in range(n):
            minCost = min(abs(i-j),abs( x-i-1) +abs(y-j-1)+1,abs( y-i-1) +abs(x-j-1)+1 )
            costList[minCost] = costList[minCost]+1


    for i in range(n):
        if i >0:
            print(costList[i]//2)

Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    n,x,y = map(int, input().split())
    costList = [0]*n

    for i in range(1, n):
        for j in range(i+1, n+1):
            if j > i:
                minCost = min(abs(i-j),abs( x-i) +abs(y-j)+1,abs( y-i) +abs(x-j)+1 )
                costList[minCost] +=1


    for i in range(n):
        if i >0:
            print(costList[i])
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    n= int(input())
    s = [int(i) for i in input().split(" ")]
    dict = {}
    for i in s:
        if i in dict:
            dict[i] = dict[i]+1
        else:
            dict[i] = 1
    sum = 0
    for i in dict.values():
        if i > 1:
            sum = sum + (i-1)*i//2
    ans = ""

    for i in s:
        num = sum
        if i in dict :
            num = num -dict[i] +1
        if ans =="":
            ans = str(num)
        else:
            ans = ans + " " + str(num)
        print(num)


Fixed submission:
if __name__ == '__main__':
    n= int(input())
    s = [int(i) for i in input().split(" ")]
    dict = {}
    for i in s:
        if i in dict:
            dict[i] = dict[i]+1
        else:
            dict[i] = 1
    sum = 0
    for i in dict.values():
        if i > 1:
            sum = sum + (i-1)*i//2

    for i in s:
        num = sum
        if i in dict :
            num = num -dict[i] +1
        print(num)
Buggy python submission (verdict: Runtime Error):
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *
sys.setrecursionlimit(10 ** 6)

def CalcList(list):
    bfnum = -1
    afterList =[]
    for i in list:
        if bfnum == -1:
            bfnum = i
        else:
            now = abs(i -bfnum)
            if now >0:
                afterList.append(now)
            bfnum = i
    return afterList

def CheckList(list):
    bfnum = -1
    count = 0
    afterList =[]
    for i in list:
        if bfnum == -1:
            bfnum = i
            afterList.append(i)
        else:
            if i == bfnum:
                count = count +1
                if count < 3:
                    afterList.append(i)
            else:
                afterList.append(i)
    return afterList


if __name__ == '__main__':
    n = int(input())
    s = input()
    list =list(map(lambda x: int(x), s))

    while(len(list) >1):
        list = CalcList(list)

    if len(list) ==0:
        print(0)
    else:
        print(list[0])

Fixed submission:
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *

maiz = []
maxh = 0
maxw = 0


def CheckCost(h, w):
    if h + 1 < maxh:
        if costList[h + 1][w] == -1 or costList[h + 1][w] > costList[h][w] + CheckColum(h + 1, w ,maiz[h][w]):
            costList[h + 1][w] = costList[h][w] + CheckColum(h + 1, w ,maiz[h][w])
            CheckCost(h + 1, w)

    if w + 1 < maxw:
        if costList[h][w + 1] == -1 or costList[h][w + 1] > costList[h][w] + CheckColum(h, w + 1,maiz[h][w]):
            costList[h][w + 1] = costList[h][w] + CheckColum(h, w + 1,maiz[h][w])
            CheckCost(h, w + 1)


def CheckColum(h, w ,s):
    if maiz[h][w] == "#" and s == ".":
        return 1
    else:
        return 0


if __name__ == '__main__':
    h, w = map(int, input().split())
    maxh = h
    maxw = w
    costList = []
    for i in range(h):
        costList.append([-1] * w)

    for i in range(h):
        s = input()
        maiz.append(list(map(lambda x: x, s)))
    if maiz[0][0] == "#":
        costList[0][0] = 1
    else:
        costList[0][0] = 0

    CheckCost(0, 0)

    print(costList[h - 1][w - 1])
Buggy python submission (verdict: Runtime Error):
red blue
5 5
blue

Fixed submission:
if __name__ == '__main__':
    s = input()
    a = s.split(" ", )
    c, d = map(int, input().split())
    f = input()
    if f  == a[0]:
        c = c-1
    else:
        d = d-1
    print(str(c)+" "+str(d))
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    n = int(input())
    s1 = [int(i) for i in input().split()]
    s2 = [int(i) for i in input().split()]
    l = []
    for i in range(n):
        l.append(i+1)
    g = []

    for v in itertools.permutations(l, n):
        h = ""
        for i in v:
            h=h+str(i)
        g.append(h)
    g.sort()

    index1 = ""
    index2 = ""
    for i in s1:
        index1 = index1 +str(i)
    for i in s2:
        index2 = index2 +str(i)

    print(abs(g.index(index1) - g.index(index2)))



Fixed submission:
import itertools

if __name__ == '__main__':
    n = int(input())
    s1 = [int(i) for i in input().split()]
    s2 = [int(i) for i in input().split()]
    l = []
    for i in range(n):
        l.append(i+1)
    g = []

    for v in itertools.permutations(l, n):
        h = ""
        for i in v:
            h=h+str(i)
        g.append(h)
    g.sort()

    index1 = ""
    index2 = ""
    for i in s1:
        index1 = index1 +str(i)
    for i in s2:
        index2 = index2 +str(i)

    print(abs(g.index(index1) - g.index(index2)))
Buggy python submission (verdict: Runtime Error):
import math

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

if __name__ == '__main__':
    a,b  = map(int, input().split())
    ans = lcm(a,b)
    print(ans)





Fixed submission:
import fractions
 
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
if __name__ == '__main__':
    a,b  = map(int, input().split())
    ans = lcm(a,b)
    print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
import copy
import math
import bisect
import pprint
import bisect

glist=[]

def makelist(max,num,list):
    if num == max:
        glist.append(list)
    else:
        list1 = copy.deepcopy(list)
        list1[num]=-1
        makelist(max,num+1,list1)
        list2 = copy.deepcopy(list)
        list2[num]=1
        makelist(max,num+1,list2)

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


if __name__ == '__main__':
    a,b  = map(int, input().split())
    ans = lcm(a,b)
    print(ans)





Fixed submission:
import fractions
 
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
if __name__ == '__main__':
    a,b  = map(int, input().split())
    ans = lcm(a,b)
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = {}
    for i in range(n):
        ans[a[i]-1] = i+1
    ans_str =""
    for i in range(n):
        if ans_str =="":
            ans_str = str(ans[i])
        else:
            ans_str = ans_str+" "+str(ans[i])
    print(ans_str)

Fixed submission:
if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = [0]*n
    for i in range(n):
        ans[a[i]-1] = i+1
    ans_list = map(str, ans)  # mapで要素すべてを文字列に
    ans_str =' '.join(ans_list)
    print(ans_str)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = [0]*n
    for i in range(n):
        ans[a[i]-1] = i+1
    ans_str =""
    for i in ans:
        if ans_str =="":
            ans_str = str(i)
        else:
            ans_str = ans_str+" "+str(i)
    print(ans_str)

Fixed submission:
if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = [0]*n
    for i in range(n):
        ans[a[i]-1] = i+1
    ans_list = map(str, ans)  # mapで要素すべてを文字列に
    ans_str =' '.join(ans_list)
    print(ans_str)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = {}
    for i in range(n):
        key = str(i+1)
        ans[key] = a[i]
    ans = sorted(ans.items(), key=lambda x: x[1])
    ans_str =""
    for i in ans:
        if ans_str =="":
            ans_str = str(i[0])
        else:
            ans_str = ans_str+" "+str(i[0])
    print(ans_str)

Fixed submission:
if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    ans = [0]*n
    for i in range(n):
        ans[a[i]-1] = i+1
    ans_list = map(str, ans)  # mapで要素すべてを文字列に
    ans_str =' '.join(ans_list)
    print(ans_str)
Buggy python submission (verdict: Runtime Error):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    
    if a[1] <= a[0]:
        print(1)
    else:
        print(2 + (a[1]-1[0])//(a[1] -1) )


Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    for i in range(1,100):
        count = 0
        
        if a[1] ==1:
            print(0)
            break
            
        if i > 1:
            count = a[0] + (a[0]-1)*(i-1)
        else:
            count = a[0]

        if count >= a[1]:
            print(i)
            break
Buggy python submission (verdict: Runtime Error):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

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

if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]

    count =Decimal(0)

    for i in b:
        count = count.sum(Decimal(1) / Decimal(i))
    
    print(Decimal(1) / Decimal(count))

Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

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

if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]

    count =Decimal(0)

    for i in b:
        count = count +(Decimal(1) / Decimal(i))

    print(Decimal(1) / Decimal(count))
Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int, input().split())

min = 2019
diff = r-l+1

for i in range(diff):
  for j in range(diff):
    if j > i:
      total = (i+l)*(j+l)
      if total > 2019:
        mod = total % 2019
        if min > mod:
           min = mod
      else:
        if min > total:
          min = total
print(min)

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

min = 2019
diff = r-l+1

if diff > 2019:
  diff = 2019

for i in range(diff):
  for j in range(diff):
    if j > i:
      total = (i+l)*(j+l)
      if total > 2019:
        mod = total % 2019
        if min > mod:
           min = mod
      else:
        if min > total:
          min = total
print(min)
Buggy python submission (verdict: Runtime Error):
    a,b, c = map(int, input().split())
    now = 0
    for num in range(10):
        if num == 0:
            now = a * c -b
        else:
            now = a * now -b
        print(now)

Fixed submission:
a,b, c = map(int, input().split())
now = 0
for num in range(10):
    if num == 0:
        now = a * c -b
    else:
        now = a * now -b
    print(now)

Buggy python submission (verdict: Runtime Error):
	a,b, c = map(int, input().split())
    now = 0
    for num in range(10):
        if num == 0:
            now = a * c -b
        else:
            now = a * now -b
        print(now)

Fixed submission:
a,b, c = map(int, input().split())
now = 0
for num in range(10):
    if num == 0:
        now = a * c -b
    else:
        now = a * now -b
    print(now)
Buggy python submission (verdict: Runtime Error):
    a, b = map(int, input().split())
    list_a = list(range(1, a, 1))
    for num in range(b):
        c, d = map(int, input().split())
        for item in list_a:
            if item <= c and  item >= d:
                list_a.remove(item)
                
    print(len(list_a))

Fixed submission:
if __name__ == '__main__':
    n, m = map(int, input().split())
    max = 0
    min = n

    for i  in range(m):
        l,r = map(int, input().split())
        if l > max:
            max = l
        if r < min:
            min = r


    if max <= min:
        print(min - max +1)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    n, k = map(int, input().split())
    ans = input()

    if n ==1:
        ans = ans.lower()
    elif n==2:
        if k == 1:
            ans = ans[0].lower() + ans[1]
        else:
            ans = ans[0]+ ans[1].lower()

    else:
        if k == 1:
            ans = ans[0].lower() + ans[1:n]
        elif k == n:
            ans = ans[0:n-1] + ans[n].lower()
        else:
            ans = ans[0:k - 1] + ans[k - 1].lower() + ans[k:n]

    print(ans)


Fixed submission:
if __name__ == '__main__':
    n, k = map(int, input().split())
    ans = input()

    if n ==1:
        ans = ans.lower()
    elif n==2:
        if k == 1:
            ans = ans[0].lower() + ans[1]
        else:
            ans = ans[0]+ ans[1].lower()

    else:
        if k == 1:
            ans = ans[0].lower() + ans[1:n]
        elif k == n:
            ans = ans[0:n-1] + ans[n-1].lower()
        else:
            ans = ans[0:k - 1] + ans[k - 1].lower() + ans[k:n]

    print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [str(i) for i in input().split()]
    
    count = 0

    for  i in range(a[0]):
        if "2" == i:
            count +=1
    print(count)


Fixed submission:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [str(i) for i in input().split()]

    count = 0

    for  i in a[0]:
        if "2" == i:
            count +=1
    print(count)