qyliang/CodeNanoFix huggingface dataset:
Buggy code:
t1,t2=map(int,input().split())
a1,a2=map(int,input().split())
b1,b2=map(int,input().split())
sa1=(a1-b1)*t1
sa2=(a2-b2)*t2
if sa1>=0:
    --sa1
    --sa2
if sa1+sa2==0:
    print("infinity")
if sa1+sa2<0:
    print(0)
if sa1+sa2>0:
    ans=(-sa1//(sa2+sa1))*2-1
    if sa1%(sa1+sa2)==0:
        ans-=1
    print(ans)


Fixed code:
t1,t2=map(int,input().split())
a1,a2=map(int,input().split())
b1,b2=map(int,input().split())
sa1=(a1-b1)*t1
sa2=(a2-b2)*t2
if sa1>=0:
    sa1*=-1
    sa2*=-1
if sa1+sa2==0:
    print("infinity")
if sa1+sa2<0:
    print(0)
if sa1+sa2>0:
    ans=((-sa1)//(sa2+sa1))*2+1
    if sa1%(sa1+sa2)==0:
        ans-=1
    print(ans)
Buggy code:
t1, t2 = [ int(v) for v in input().split() ]
a1, a2 = [ int(v) for v in input().split() ]
b1, b2 = [ int(v) for v in input().split() ]
t = t1 + t2

if a1*t1 + a2*t2 == b1*t1 + b2*t2:
    ans = -1
else:
    if a1 >= b1 and  a2 >= b2:
        ans = 0
    elif a1 <= b1 and  a2 <= b2:
        ans = 0
    else:
        if a1*t1 + a2*t2 < b1*t1 + b2*t2:
            a1, b1 = b1, a1
            a2, b2 = b2, a2

        mind = a1*t1 - b1*t1
        lastd = a1*t1 + a2*t2 - b1*t1 - b2*t2
        mind = abs(mind)
        if mind % lastd == 0:
            ans = 2 * (mind // lastd) + 2
        else:
            ans = 2 * (mind // lastd) + 1
        print(mind, lastd)
    
print(ans if ans != -1 else "infinity")

Fixed code:
t1, t2 = [ int(v) for v in input().split() ]
a1, a2 = [ int(v) for v in input().split() ]
b1, b2 = [ int(v) for v in input().split() ]

if a1*t1 + a2*t2 == b1*t1 + b2*t2:
    ans = -1
else:
    if a1*t1 + a2*t2 < b1*t1 + b2*t2:
        a1, b1 = b1, a1
        a2, b2 = b2, a2

    mind = a1*t1 - b1*t1
    if mind > 0:
        ans = 0
    else:
        lastd = a1*t1 + a2*t2 - b1*t1 - b2*t2
        mind = abs(mind)
        if mind % lastd == 0:
            ans = 2 * (mind // lastd) 
        else:
            ans = 2 * (mind // lastd) + 1
    
print(ans if ans != -1 else "infinity")
Buggy code:
T1,T2 = map(int, input().split())
A1,A2 = map(int, input().split())
B1,B2 = map(int, input().split())
d1,d2 = (A1-B1)*T1,(A2-B2)*T2
if d1+d2 == 0: print("infinity")
elif abs(d1) > abs(d2): print(0)
elif abs(d1) % abs(d1+d2) == 0: print(abs(d1//(d1+d2))*2)
else: print(abs(d1//(d1+d2))*2+1)

Fixed code:
T1,T2 = map(int, input().split())
A1,A2 = map(int, input().split())
B1,B2 = map(int, input().split())
d1,d2 = (A1-B1)*T1,(A2-B2)*T2
if d1 < 0: d1,d2 = -d1,-d2
if d1+d2 == 0: print("infinity")
elif d1+d2>0: print(0)
elif d1 % (-(d1+d2)) == 0: print(d1//(-(d1+d2))*2)
else: print(d1//(-(d1+d2))*2+1)
Buggy code:
t,T,a,A,b,B=map(int,open(0).read().split())
x,y=(b-a)*t,(A-B)*T
if y-x==0:
 r="infinity"
else:
 s,t=divmod(x,y-x)
 t=0
 r=max(0,s*2+bool(t))
print(r)

Fixed code:
t,T,a,A,b,B=map(int,open(0).read().split())
x,y=(b-a)*t,(A-B)*T
if y-x==0:
 r="infinity"
else:
 s,t=divmod(x,y-x)
 r=max(0,s*2+bool(t))
print(r)
Buggy code:
t,T,a,A,b,B=map(int, open(0).read().split())
x,y=(a-b)*t,(A-B)*T
if x+y==0:
 r="infinity"
else:
 s,t=divmod(-y, x+y)
 r=0 if s<0 else s*2+(1 if t else 0)
print(r)

Fixed code:
t,T,a,A,b,B=map(int, open(0).read().split())
x,y=(a-b)*t,(A-B)*T
if x+y==0:
 r="infinity"
else:
 s,t=divmod(-x, x+y)
 r=0 if s<0 else s*2+(1 if t else 0)
print(r)
Buggy code:

T1,T2=[int(i) for i in input().split()]
A1,A2=[int(i) for i in input().split()]
B1,B2=[int(i) for i in input().split()]
if((B1-A1)*((B1-A1)*T1+(B2-A2)*T2)>0):
  print(0);
  exit();
if((B1-A1)*T1+(B2-A2)*T2==0):
  print("infinity")
  exit();
ans=(abs((B1-A1)*T1)/abs((B1-A1)*T1+(B2-A2)*T2))*2+1
if(abs((B1-A1)*T1)%abs((B1-A1)*T1+(B2-A2)*T2)==0):
  ans-=1
print(int(ans))



Fixed code:
T1,T2=[int(i) for i in input().split()]
A1,A2=[int(i) for i in input().split()]
B1,B2=[int(i) for i in input().split()]
if((B1-A1)*((B1-A1)*T1+(B2-A2)*T2)>0):
  print(0);
  exit();
if((B1-A1)*T1+(B2-A2)*T2==0):
  print("infinity")
  exit();
ans=(abs((B1-A1)*T1)//abs((B1-A1)*T1+(B2-A2)*T2))*2+1
if(abs((B1-A1)*T1)%abs((B1-A1)*T1+(B2-A2)*T2)==0):
  ans-=1
print(ans)
Buggy code:
from decimal import Decimal
T = tuple(map(Decimal, input().split()))

A = list(map(Decimal, input().split()))
B = list(map(Decimal, input().split()))


ans = 0
if A[0] < B[0]:
    tmp = (A[0], A[1])
    A[0], A[1] = B[0], B[1]
    B[0], B[1] = tmp[0], tmp[1]

a = abs(T[0]*A[0] - T[0]*B[0])

b = T[0]*(B[0]-A[0])+T[1]*(B[1]-A[1])


if b == 0:
    print("Infinity")
elif b < 0:
    print(0)
    exit(0)
else:
    ans += 1
    if b > a:
        print(1)
    elif b == a:
        print("Infinity")
    else:
        print((a*2)//b)


Fixed code:
from decimal import Decimal
T = tuple(map(Decimal, input().split()))

A = list(map(Decimal, input().split()))
B = list(map(Decimal, input().split()))


ans = 0
if A[0] < B[0]:
    tmp = (A[0], A[1])
    A[0], A[1] = B[0], B[1]
    B[0], B[1] = tmp[0], tmp[1]

a = abs(T[0]*A[0] - T[0]*B[0])

b = T[0]*(B[0]-A[0])+T[1]*(B[1]-A[1])


if b == 0:
    print("infinity")
elif b < 0:
    print(0)
    exit(0)
else:
    ans += 1
    if b > a:
        print(1)
    elif b == a:
        print("infinity")
    else:
        if a % b == 0:
            print((a//b)*2)
        else:
            print((a//b)*2 + 1)
Buggy code:
t1,t2 = map(int, input().split()))
a1,a2 = map(int, input().split()))
b1,b2 = map(int, input().split()))
x,y=(a1-b1)*t1 + (a2-b2)*t2, (a1-b1)*t1
if x == 0:
    print("infinity")
elif x*y > 0:
    print(0)
else:
    s,t = divmod(abs(y), abs(x))
    print(s*2+1 if t else 0)

Fixed code:
t1,t2 = list(map(int, input().split()))
a1,a2 = list(map(int, input().split()))
b1,b2 = list(map(int, input().split()))
x=(a1-b1)*t1 + (a2-b2)*t2
if x == 0:
    print("infinity")
elif x*(a1-b1) > 0:
    print(0)
else:
    s,t = divmod(abs((a1-b1)*t1), abs(x))
    if t:
        print(s*2+1)
    else:
        print(s*2)
Buggy code:
def meet(faster, slower):
  if slower[0] - faster[0] < 0:
    print(0)
  else:
    print((slower[0] - faster[0]) // (faster[1] - slower[1]) + 1)

t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())

at1 = a1 * t1
at2 = a2 * t2
bt1 = b1 * b1
bt2 = b2 * b2

if at1 + at2 < bt1 + bt2:
  faster = [bt1, bt1 + bt2]
  slower = [at1, at1 + at2]
  meet(faster, slower)
elif at1 + at2 > bt1 + bt2:
  faster = [at1, at1 + at2]
  slower = [bt1, bt1 + bt2]
  meet(faster, slower)
else:
  print('infinity')

Fixed code:
def meet(faster, slower):
  if slower[0] - faster[0] < 0:
    print(0)
  else:
    count = (slower[0] - faster[0]) // (sum(faster) - sum(slower))
    if (slower[0] - faster[0]) % (sum(faster) - sum(slower)) == 0:
      print(count * 2)
    else:
      print(count * 2 + 1)

t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())

at1 = a1 * t1
at2 = a2 * t2
bt1 = b1 * t1
bt2 = b2 * t2

if at1 + at2 < bt1 + bt2:
  faster = [bt1, bt2]
  slower = [at1, at2]
  meet(faster, slower)
elif at1 + at2 > bt1 + bt2:
  faster = [at1, at2]
  slower = [bt1, bt2]
  meet(faster, slower)
else:
  print('infinity')
Buggy code:
import math


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def main():
    T1, T2 = read_values()
    A1, A2 = read_values()
    B1, B2 = read_values()

    if A1 * T1 + A2 * T2 == B1 * T1 + B2 * T2:
        print("infinity")
        return

    D1 = (A1 - B1) * T1
    D2 = (A2 - B2) * T2

    if D1 * D2 > 0:
        print(0)
        return

    D1 = abs(D1)
    D2 = abs(D2)

    if D1 > D2:
        print(0)
        return

    print(D1, D2)
    i = math.ceil(D1 / (D2 - D1))
    if i == D1 // (D2 - D1):
        print(i * 2)
    else:
        print(1 + 2 * (i - 1))


if __name__ == '__main__':
    main()


Fixed code:
import math


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def main():
    T1, T2 = read_values()
    A1, A2 = read_values()
    B1, B2 = read_values()

    if A1 * T1 + A2 * T2 == B1 * T1 + B2 * T2:
        print("infinity")
        return

    D1 = (A1 - B1) * T1
    D2 = (A2 - B2) * T2

    if D1 * D2 > 0:
        print(0)
        return

    D1 = abs(D1)
    D2 = abs(D2)

    if D1 > D2:
        print(0)
        return

    i = D1 // (D2 - D1)
    if D1 == i * (D2 - D1):
        print(i * 2)
    else:
        print(1 + 2 * i)


if __name__ == '__main__':
    main()
Buggy code:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    t1, t2 = LI()
    a1, a2 = LI()
    b1, b2 = LI()

    if a1 < b1:
        tmp = b1
        b1 = a1
        a1 = tmp

        tmp = b2
        b2 = a2
        a2 = tmp

    l1 = (a1 - b1) * t1
    l2 = (a2 - b2) * t2
    l3 = l1 + l2
    print(l1, l2)
    if l3 == 0:
        print("infinity")
        return
    if l3 > 0:
        print(0)
        return
    ans = 1
    print(ans + 2 * (l1 // (-l3)))






if __name__ == '__main__':
    main()

Fixed code:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    t1, t2 = LI()
    a1, a2 = LI()
    b1, b2 = LI()

    if a1 < b1:
        tmp = b1
        b1 = a1
        a1 = tmp

        tmp = b2
        b2 = a2
        a2 = tmp

    l1 = (a1 - b1) * t1
    l2 = (a2 - b2) * t2
    l3 = l1 + l2

    if l3 == 0:
        print("infinity")
        return
    if l3 > 0:
        print(0)
        return
    ans = 1
    if l1 % (-l3) == 0:
        print(ans + 2 * (l1 // (-l3)) - 1)
        return
    print(ans + 2 * (l1 // (-l3)))






if __name__ == '__main__':
    main()
Buggy code:
t=list(map(int,input().split()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if t[0]*a[0]+t[1]*a[1]==t[0]*b[0]+t[1]*b[1]:
  print("infinity")
else:
  if t[0]*a[0]>t[0]*b[0]:
    if t[0]*a[0]+t[1]*a[1]>t[0]*b[0]+t[1]*b[1]:
      print(0)
    else:
      d=(t[0]*b[0]+t[1]*b[1])-(t[0]*a[0]+t[1]*a[1])
      c=t[0]*a[0]-t[0]*b[0]
      if c//d==0:
        print(c//d*2)
      else:
        print(c//d*2+1)
  else:
    if t[0]*a[0]+t[1]*a[1]<t[0]*b[0]+t[1]*b[1]:
      print(0)
    else:
      d=(t[0]*a[0]+t[1]*a[1])-(t[0]*b[0]+t[1]*b[1])
      c=t[0]*b[0]-t[0]*a[0]
      if c//d==0:
        print(c//d*2)
      else:
        print(c//d*2+1)
    
      

Fixed code:
t=list(map(int,input().split()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if t[0]*a[0]+t[1]*a[1]==t[0]*b[0]+t[1]*b[1]:
  print("infinity")
else:
  if t[0]*a[0]>t[0]*b[0]:
    if t[0]*a[0]+t[1]*a[1]>t[0]*b[0]+t[1]*b[1]:
      print(0)
    else:
      d=(t[0]*b[0]+t[1]*b[1])-(t[0]*a[0]+t[1]*a[1])
      c=t[0]*a[0]-t[0]*b[0]
      if c%d==0:
        print(c//d*2)
      else:
        print(c//d*2+1)
  else:
    if t[0]*a[0]+t[1]*a[1]<t[0]*b[0]+t[1]*b[1]:
      print(0)
    else:
      d=(t[0]*a[0]+t[1]*a[1])-(t[0]*b[0]+t[1]*b[1])
      c=t[0]*b[0]-t[0]*a[0]
      if c%d==0:
        print(c//d*2)
      else:
        print(c//d*2+1)
Buggy code:
t1,t2=map(int,input().split())
a1,a2=map(int,input().split())
b1,b2=map(int,input().split())
a=t1*a1+t2*a2
b=t1*b1+t2*b2
if a==b:
    print('infinity')
    exit()
if a>b:
    if a1>b1:
        print(0)
    else:
        m=b1-a1
        k=m*t1
        p=a-b
        print(1-(-k//p)*2)
if a<b:
    if a1<b1:
        print(0)
    else:
        m=a1-b1
        k=m*t1
        p=b-a
        print(1-(-k//p)*2)

Fixed code:
t1,t2=map(int,input().split())
a1,a2=map(int,input().split())
b1,b2=map(int,input().split())
a=t1*a1+t2*a2
b=t1*b1+t2*b2
if a==b:
    print('infinity')
    exit()
if a>b:
    if a1>b1:
        print(0)
    else:
        m=b1-a1
        k=m*t1
        p=a-b
        q=1+(k//p)*2
        if k%p==0:
            q-=1
        print(q)
        
if a<b:
    if a1<b1:
        print(0)
    else:
        m=a1-b1
        k=m*t1
        p=b-a
        q=1+(k//p)*2
        if k%p==0:
            q-=1
        print(q)
Buggy code:
T = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
if A[0]*T[0]+A[1]*T[1] == B[0]*T[0]+B[1]*T[1]:
  print('infinity')
else:
  if A[0]*T[0]+A[1]*T[1] < B[0]*T[0]+B[1]*T[1]:
    C = A
    A = B
    B = C
  if A[0] > B[0]:
    print('0')
  else:
    bcover = (B[0]-A[0])*T[0]
    tcover = A[0]*T[0]+A[1]*T[1] - B[0]*T[0]-B[1]*T[1]
    print(A,B,bcover,tcover, bcover/tcover)
    if bcover%tcover == 0:
      print(int(bcover/tcover)*2)
    else:
      print(int(bcover/tcover)*2+1)

Fixed code:
T = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
if A[0]*T[0]+A[1]*T[1] == B[0]*T[0]+B[1]*T[1]:
  print('infinity')
else:
  if A[0]*T[0]+A[1]*T[1] < B[0]*T[0]+B[1]*T[1]:
    C = A
    A = B
    B = C
  if A[0] > B[0]:
    print('0')
  else:
    bcover = (B[0]-A[0])*T[0]
    tcover = A[0]*T[0]+A[1]*T[1] - B[0]*T[0]-B[1]*T[1]
    if bcover%tcover == 0:
      print(int(bcover/tcover)*2)
    else:
      print(int(bcover/tcover)*2+1)
Buggy code:
t1,t2 = map(int,input().split())

a1,a2 = map(int,input().split())
b1,b2 = map(int,input().split())
c1 = b1-a1
c2 = b2-a2

s = t1*c1
t = s + t2*c2
print(c1,c2,s,t)
ans = -1
if s * t > 0:
    ans = 0
elif t == 0:
    ans="infinity"
else:
    if s > t:
        tt = abs(t)
        ans = -((-s / tt)//1)*2 - 1
        if s / tt - s//tt < 10**-25:
            ans += 1
    else:
        ss = abs(s)
        ans = -((-ss / t)//1)*2 - 1
        if ss / t -ss//t < 10**-25:
            ans += 1
print(int(ans))

Fixed code:
t1,t2 = map(int,input().split())

a1,a2 = map(int,input().split())
b1,b2 = map(int,input().split())
c1 = b1-a1
c2 = b2-a2

s = t1*c1
t = s + t2*c2
# print(c1,c2,s,t)
ans = -1
if s * t > 0:
    ans = 0
elif t == 0:
    ans=-10
else:
    if s > t:
        tt = abs(t)
        ans = -((-s / tt)//1)*2 - 1
        if s / tt - s//tt < 10**-25:
            ans += 1
    else:
        ss = abs(s)
        ans = -((-ss / t)//1)*2 - 1
        if ss / t -ss//t < 10**-25:
            ans += 1
if ans == -10:
    print("infinity")
else:
    print(int(ans))
Buggy code:
from sys import stdin


def input():
    return stdin.readline()[:-1]


def intput():
    return int(input())


def sinput():
    return input().split()


def intsput():
    return map(int, sinput())


# Code

t1, t2 = intsput()

a1, a2 = intsput()

b1, b2 = intsput()

leap1 = a1 * t1 + a2 * t2
leap2 = b1 * t1 + b2 * t2

if leap1 == leap2:
    print('infinity')
    exit()


if leap2 < leap1:
    print('swap')
    a1, a2, b1, b2 = b1, b2, a1, a2
    leap1, leap2 = leap2, leap1

lag = leap2 - leap1
print(leap1, leap2, lag)

# 1 is always slower
if a1 < b1 and a2 < b2:
    print(0)
    exit()

if a1 > b1:
    gap = (a1 - b1) * t1
    print(gap // lag * 2 + 1)
    exit()

print(0)


Fixed code:
from sys import stdin


def input():
    return stdin.readline()[:-1]


def intput():
    return int(input())


def sinput():
    return input().split()


def intsput():
    return map(int, sinput())


# Code

t1, t2 = intsput()

a1, a2 = intsput()

b1, b2 = intsput()

leap1 = a1 * t1 + a2 * t2
leap2 = b1 * t1 + b2 * t2

if leap1 == leap2:
    print('infinity')
    exit()


if leap2 < leap1:
    a1, a2, b1, b2 = b1, b2, a1, a2
    leap1, leap2 = leap2, leap1

lag = leap2 - leap1

# 1 is always slower
if a1 < b1 and a2 < b2:
    print(0)
    exit()

if a1 > b1:
    gap = (a1 - b1) * t1
    q = gap // lag
    ans = q * 2 + 1
    if lag * q == gap:
        ans -= 1
    print(ans)
    exit()

print(0)
Buggy code:
t1,t2 = map(int, input().split( ))
a1,a2 = map(int, input().split( ))
b1,b2 = map(int, input().split( ))
a1*=t1
b1*=t1
a2*=t2
b2*=t2

if a1+a2==b1+b2:
    print("infinity")
    exit()
if a1+a2>b1+b2:
    a1,a2,b1,b2 = b1,b2,a1,a2
if a1<b1:
    print(0)
    exit()
if (a1-b1)//(b1+b2-a1-a2)==0:
    print(((a1-b1)//(b1+b2-a1-a2))*2)
else:
    print(((a1-b1)//(b1+b2-a1-a2))*2+1)


Fixed code:
t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())

if a1 * t1 + a2 * t2 == b1 * t1 + b2 * t2:
    print('infinity')
    exit()

if a1 * t1 + a2 * t2 < b1 * t1 + b2 * t2:
    a1, a2, b1, b2 = b1, b2, a1, a2

if a1 > b1:
    print(0)
    exit()

x = (b1 - a1) * t1
y = a1 * t1 + a2 * t2 - b1 * t1 - b2 * t2

if x % y == 0:
    print(x // y * 2)
else:
    print(x // y * 2 + 1)
Buggy code:
    T1, T2 = map(int, input().split())
    A1, A2 = map(int, input().split())
    B1, B2 = map(int, input().split())
     
    P = (A1 - B1) * T1
    Q = (A2 - B2) * T2
    if P > 0:
    	P *= -1
    	Q *= -1
     
    if P + Q < 0:
    	print(0)
    elif P + Q == 0:
    	print("infinity")
    else:
    	S = (-P) // (P + Q)
    	T = (-P) % (P + Q)
    	if T != 0:
    		print(S * 2 + 1)
    	else:
    		print(S * 2)

Fixed code:
T1, T2 = map(int, input().split())
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())

P = (A1 - B1) * T1
Q = (A2 - B2) * T2
if P > 0:
	P *= -1
	Q *= -1

if P + Q < 0:
	print(0)
elif P + Q == 0:
	print("infinity")
else:
	S = (-P) // (P + Q)
	T = (-P) % (P + Q)
	if T != 0:
		print(S * 2 + 1)
	else:
		print(S * 2)
Buggy code:
X, Y = map(int, input().split())

ans = max(0, (4 - X) * 100000)
ans+ = max(0, (4 - Y) * 100000)

if X == Y == 1:
    ans += 100000 * 4

print (ans)

Fixed code:
X, Y = map(int, input().split())

ans = max(0, (4 - X) * 100000)
ans+= max(0, (4 - Y) * 100000)

if X == Y == 1:
    ans += 100000 * 4

print (ans)
Buggy code:
a,b=map(int,input().split())
dic={3:1,2:2,1:3}
c=0
if a==1 and b==1:
	c+=dic[a]*10**5+dic[b]*10**5+4*10**5
    print(c)
    
else:
  if a in dic and b in dic:
    c+=dic[a]*10**5+dic[b]*10**5
    print(c)
   
  elif a in dic and b not in dic:
    c+=dic[a]*10**5
    print(c)
    
  elif a not in dic and b in dic:
    c+=dic[b]*10**5
    print(c)
   
    


Fixed code:
a,b=map(int,input().split())
dic={1:3*10**5,2:2*10**5,3:1*10**5}
c=0
if a in dic and b in dic:
    if a==1 and b==1:
        c+=dic[a]+dic[b]+4*10**5
        print(c)
    else:
        c+=dic[a]+dic[b]
        print(c)

elif a in dic and b not in dic:
    c+=dic[a]
    print(c)


elif b in dic and a not in dic:
    c+=dic[b]
    print(c)

else:
    print(c)
Buggy code:
x,y=map(int,input().split())
ttl=0
if x>3 and y>3:
  #do nothing
else:
  for i in range(1,4):
    ttl=(4-i)*100000
    for j in range(1,4):
    	ttl=ttl+(4-j)*100000
        break
  if ttl==600000:
    ttl=ttl+400000
print(ttl)

Fixed code:
x,y=map(int,input().split())

ttl=0
if(x>3 and y>3):
  ttl=0
else:
  for i in range(1,4):
    if i==x:
        ttl=(4-i)*100000
        break
  for j in range(1,4):
    if j==y:
        ttl=ttl+(4-j)*100000
        break
  if ttl==600000:
    ttl=ttl+400000
print(ttl)
Buggy code:
input_line = input().split()
num_1 = int(input_line[0])
num_2 = int(input_line[1])
worse = 0
if num_1 == 1:
  worse += 300000
elif num_1 == 2:
  worse += 200000
elif num_1 == 3:
  worse += 100000
if num_2 == 1:
  worse += 300000
elif num_2 == 2:
  worse += 200000
elif num_2 == 3:
  worse += 100000
if num_1 == 1 and num_2 == 1:
  worse += 400000

Fixed code:
input_line = input().split()
num_1 = int(input_line[0])
num_2 = int(input_line[1])
worse = 0
if num_1 == 1:
  worse += 300000
elif num_1 == 2:
  worse += 200000
elif num_1 == 3:
  worse += 100000
if num_2 == 1:
  worse += 300000
elif num_2 == 2:
  worse += 200000
elif num_2 == 3:
  worse += 100000
if num_1 == 1 and num_2 == 1:
  worse += 400000
print(worse)
Buggy code:
x,y=map(int,input().split())
ans=0
if x==1 and y==1:
    ans+=400000
if x==3:
    ans+=100000
if x==2:
    ans+=200000
if x==1:
    ans+=300000
if y==3:
    ans+=100000
if y==2:
    ans+=200000
if y==1:
    ans+=300000
print(ans)
~


Fixed code:
x,y=map(int,input().split())
ans=0
if x==1 and y==1:
    ans+=400000
if x==3:
    ans+=100000
if x==2:
    ans+=200000
if x==1:
    ans+=300000
if y==3:
    ans+=100000
if y==2:
    ans+=200000
if y==1:
    ans+=300000
print(ans)
Buggy code:
x,y=map(int,input().split())
m={1:300000,2:200000,3:100000}
ans=m[x]+m[y]
if x==y:
    ans+=400000
print(ans)

Fixed code:
x,y=map(int,input().split())
m={1:300000,2:200000,3:100000}
ans=0
if x<=3:
   ans=m[x]
if y<=3:
    ans+=m[y]
if x==y and y==1:
    ans+=400000
print(ans)
Buggy code:
X, Y = map(int, input().split())
ans = 0
if X >= 3:
    ans += (4 - X) * 100000
if Y >= 3:
    ans += (4 - Y) * 100000
if X == 1 and Y == 1:
    ans += 400000

print(ans)

Fixed code:
X, Y = map(int, input().split())
ans = 0
if X <= 3:
    ans += (4 - X) * 100000
if Y <= 3:
    ans += (4 - Y) * 100000
if X == 1 and Y == 1:
    ans += 400000

print(ans)
Buggy code:
X, Y = map(int, input().split())
ans = 0
for z in [X,Y]:
  if z == 3:
    ans += 10**5
  elif z == 2:
    ans += 2*10**5
  elif z == 1:
    ans += 3*10**5
if X == Y:
  ans += 4*10**5
print(ans)

Fixed code:
X, Y = map(int, input().split())
ans = 0
for z in [X,Y]:
  if z == 3:
    ans += 10**5
  elif z == 2:
    ans += 2*10**5
  elif z == 1:
    ans += 3*10**5
if X == Y == 1:
  ans += 4*10**5
print(ans)
Buggy code:
x,y = map(int,input().split())
ans = 0
if x == 1 and y == 1:
  print(1000000)
elif x < 4 and y > 3:
  ans += 100000*(4-x)
elif x > 3 and y < 4:
  ans += 100000*(4-y)
elif x < 4 and y < 4:
  ans += 100000*(8-x-y)
else:
  print(0)
print(ans)

Fixed code:
x,y = map(int,input().split())
if x == 1 and y == 1:
  print(1000000)
elif x < 4 and y > 3:
  print(100000*(4-x))
elif x > 3 and y < 4:
  print(100000*(4-y))
elif x < 4 and y < 4:
  print(100000*(8-x-y))
else:
  print(0)
Buggy code:
X,Y = map(int,input().split())
if X*Y == 1:
    print(10^6)
else:
  print(10^5*(max(0,4-X)+max(0,4-X)))


Fixed code:
X,Y = map(int,input().split())
if X*Y == 1:
    print(10**6)
else:
  print(10**5*(max(0,4-X)+max(0,4-Y)))
Buggy code:
x,y=(int(x) for x in input().split())
b = 0
if x == 1:
    b += 300000
elif x == 2:
    b += 200000
elif x == 3:
    b += 100000
if y == 1:
    b += 300000
elif y == 2:
    b += 200000
elif y == 3:
    b += 100000
elif x == 1 and y == 1:
    b += 400000
else:
    pass
print(b)

Fixed code:
x,y=(int(x) for x in input().split())
b = 0
if x == 1:
    b += 300000
elif x == 2:
    b += 200000
elif x == 3:
    b += 100000
else:
    b += 0
if y == 1:
    b += 300000
elif y == 2:
    b += 200000
elif y == 3:
    b += 100000
else:
    b += 0
if x == 1 and y == 1:
    b += 400000

print(b)
Buggy code:
x, y = map(int, input().split())
sum = 0
if x < 4:
  sum += (4-x) * 100000
if y < 4:
  sum += (4-y) * 100000
if x == 1 and y == 1:
  sum += 4 * 100000
  print(sum)

Fixed code:
x, y = map(int, input().split())
sum = 0
if x < 4:
  sum += (4-x) * 100000
if y < 4:
  sum += (4-y) * 100000
if x == 1 and y == 1:
  sum += 4 * 100000
print(sum)
Buggy code:
x,y=map(int,input())
if(x==y==1):
  print(1000000)
else:
  ans=max(4-x,0)*100000+max(4-y,0)*100000
  print(ans)

Fixed code:
x,y=map(int,input().split())
if(x==y==1):
  print(1000000)
else:
  ans=max(4-x,0)*100000+max(4-y,0)*100000
  print(ans)
Buggy code:
x,y = map(int,input().split())
if x == 1 and y == 1:print(int(7e5))
elif 1<=x<=3 and 1<=y<=3:
    print(int((8-x-y)*1e5))
elif 1<=x<=3:print(int((4-x)*1e5))
elif 1<=y<=3:print(int((4-y)*1e5))
else:print(0)

Fixed code:
x,y = map(int,input().split())
if x == 1 and y == 1:print(int(10e5))
elif 1<=x<=3 and 1<=y<=3:
    print(int((8-x-y)*1e5))
elif 1<=x<=3:print(int((4-x)*1e5))
elif 1<=y<=3:print(int((4-y)*1e5))
else:print(0)
Buggy code:
X,Y = input().split()
X,Y = int(X),int(Y)
if(X>=4):
    X = 0
if(Y>=4):
    Y = 0
    
if(X==Y and X==1):
    print(1000000)
else:
    print((X+Y)*100000)
    

Fixed code:
X,Y = input().split()
X,Y = int(X),int(Y)

if(X==Y and X==1):
    print(1000000)
    
else:
    if(X>=4):
        X = 0
    if(Y>=4):
        Y = 0

    if(X==1):
        X = 3
    elif(X==3):
        X = 1

    if(Y==1):
        Y = 3
    elif(Y==3):
        Y = 1
        
    print((X+Y)*100000)