Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = [int(x) for x in input().split()]

num = n-k

ans = 1
before = 0

for i in range(num+1):
    ans *= a[i]

for i in range(1,num+1):
    before = ans
    ans = ans/ a[i-1] * a[i+k-1]
    if before >= ans:
        print("No")
    else:
        print("Yes")


Fixed submission:
n,k = map(int,input().split())
a = [int(x) for x in input().split()]

num = n-k

for i in range(1,num+1):
    if a[i-1] >= a[i+k-1]:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
n,m,k = map(int,input().split())

a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

if k < a[0] and k < b[0]:
    print(0)
    exit()

if sum(a) + sum(b) <= k:
    print(n+m)
    exit()

a_temp = a[0]
b_temp = b[0]
temp = 0
count = 0
hour = 0
i = 0
j = 0

while k > hour:
    
    count += 1
    if a_temp <= b_temp:
        hour += a_temp
        i += 1
        if i == len(a):
            a_temp = 10**10
        else:
            a_temp = a[i]
    else:
        hour += b_temp
        j += 1
        if j == len(b):
            b_temp = 10**10
        else:
            b_temp = b[i]

print(count)


Fixed submission:
n,m,k = map(int,input().split())

A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

a, b = [0], [0]
for i in range(n):
     a.append(a[i] + A[i])
for i in range(m):
     b.append(b[i] + B[i])

ans, j = 0, m
for i in range(n + 1):
    if a[i] > k:
        break
    while b[j] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())

ans = 0

for j in range(1,n+1):
    y = math.floor(n/j)
    ans += y*(y+1)*j/2

print(int(ans))


Fixed submission:
import math
n = int(input())

ans = 0

for j in range(1,n+1):
    y = n//j
    ans += y*(y+1)*j/2

print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

a.sort()

if n == 1:
    print(1)
    exit()

num = 1
count = 1

for i in range(1,n):
    for j in range(num):
        if i+1 < n and a[i] == a[i+1]:
            count -= 1
            break
        if a[i] % a[j]== 0:
            count -= 1
            break
    num += 1
    count += 1
if a[0] == a[1]:
    count -= 1

print(count)


Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

a.sort()

if n == 1:
    print(1)
    exit()

ans = [1] * (a[n-1]+1)

for i in range(n):
    if i >= 1 and a[i] == a[i-1]:
        ans[a[i]] = 0

    else:
        j = 2
        while j*a[i] <= a[n-1]:
            ans[j*a[i]] = 0
            j += 1


sum = 0

for i in range(n):
    sum += ans[a[i]]


print(sum)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())

count = 0

def sosu(n,z):
    for i in range(z, int(math.sqrt(n))+1):
        if n%i == 0:
            return i
            break
    return -1

if sosu(n,2) == -1 and n != 1:
    print(1)
    exit()

ans  = 0
z = 2

def hantei(n):
    i = sosu(n,2)
    s = 0
    if sosu(n,2) == -1:
        return True
    if sosu(n,2) > 0:
        s = n ** (1/i)
        if int(s) == math.floor(s):
            #print(n,s)
            return True
        else:
            return False

memo = []

while(n != 1) :
    ans = sosu(n,z)
    print(n,ans,z)
    if ans == -1:
        if memo.count(n) == 0 and hantei(n):
            count +=1
            break
        else:
            break

    if hantei(ans) :
        memo.append(ans)
        z = ans+1
        n = n//ans
        count += 1
    else:
        z = ans +1
    #print(count)



print(count)


Fixed submission:
n, m = map(int,input().split())
print(n*m)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())

count = 0

def sosu(n,z):
    for i in range(z, int(math.sqrt(n))+1):
        if n%i == 0:
            return i
            break
    return -1

if sosu(n,2) == -1 and n != 1:
    print(1)
    exit()

ans  = 0
z = 2

def hantei(n):
    i = sosu(n,2)
    s = 0
    if sosu(n,2) == -1:
        return True
    if sosu(n,2) > 0:
        s = n ** (1/i)
        if int(s) == math.floor(s):
            print(n,s)
            return True
        else:
            return False

memo = []

while(n != 1) :
    ans = sosu(n,z)
    print(n,ans,z)
    if ans == -1:
        if memo.count(n) == 0 and hantei(n):
            count +=1
            break
        else:
            break

    if hantei(ans) :
        memo.append(ans)
        z = ans+1
        n = n//ans
        count += 1
    else:
        z = ans +1
    #print(count)



print(count)


Fixed submission:
n, m = map(int,input().split())
print(n*m)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

ans = 1
for i in range(n):
    ans = ans * a[i]

if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]

if a.count(0) > 0:
    print(0)
    exit()

ans = 1

for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        exit()


if ans > 10**18:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())

count = 0

def sosu(n,z):
    for i in range(z, int(math.sqrt(n))+1):
        if n%i == 0:
            return i
            break
    return -1

if sosu(n,2) == -1 and n != 1:
    print(1)
    exit()

ans  = 0
z = 2

def hantei(n):
    i = sosu(n,2)
    s = 0
    if sosu(n,2) == -1:
        return True
    if sosu(n,2) > 0:
        s = n ** (1/i)
        if int(s) == math.floor(s):
            #print(n,s)
            return True
        else:
            return False

memo = []

while(n != 1) :
    ans = sosu(n,z)
    print(n,ans,z)
    if ans == -1:
        if memo.count(n) == 0 and hantei(n):
            count +=1
            break
        else:
            break

    if hantei(ans) :
        memo.append(ans)
        z = ans+1
        n = n//ans
        count += 1
    else:
        z = ans +1
    #print(count)



print(count)


Fixed submission:
import math
from decimal import Decimal
n, m = input().split()
x = Decimal(n)
y = Decimal(m)
#print(n,m)
ans = math.floor(x*y)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n, m = input().split()
x = decimal(n)
y = decimal(m)
ans = math.floor(x*y)
print(ans)

Fixed submission:
import math
from decimal import Decimal
n, m = input().split()
x = Decimal(n)
y = Decimal(m)
#print(n,m)
ans = math.floor(x*y)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n, m = input().split()
x = decimal(n)
y = dicimal(m)
ans = math.floor(x*y)
print(ans)


Fixed submission:
import math
from decimal import Decimal
n, m = input().split()
x = Decimal(n)
y = Decimal(m)
#print(n,m)
ans = math.floor(x*y)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m  = map(int,input().split())
a = [int(x) for x in input().split()]

ans1 = [1]
temp = 0
count = 0
while(True):
    ans1 += [a[temp]]
    temp = a[temp]-1
    if len(ans1) !=  len(set(ans1)):
        break
    if len(ans1) == m+1:
        print(ans1[len(ans1)-1])
        exit()

num1 = ans1.index(temp+1)
ans2 = ans1[num1:len(ans1)-1]
#print(ans2)
num = len(ans2)

print(ans2[(m-num1)%num])


Fixed submission:
n,m  = map(int,input().split())
a = [int(x) for x in input().split()]

ans1 = [1]
temp = 0
visit = [0]*(n+1)
visit[1] = 1
while(True):
    ans1 += [a[temp]]

    if visit[a[temp]] == 1:
        break

    visit[a[temp]] = 1
    temp = a[temp]-1


    if len(ans1) == m+1:
        print(ans1[len(ans1)-1])
        exit()


num1 = ans1.index(a[temp])
ans2 = ans1[num1:len(ans1)-1]

num = len(ans2)

print(ans2[(m-num1)%num])

Buggy python submission (verdict: Time Limit Exceeded):
n,m  = map(int,input().split())
a = [int(x) for x in input().split()]

ans1 = [1]
temp = 0
count = 0
while(True):
    ans1 += [a[temp]]
    temp = a[temp]-1
    if len(ans1) !=  len(set(ans1)):
        break
    count += 1
    if count == m:
        print(ans1[len(ans1)-1])
        exit()

num1 = ans1.index(temp+1)
ans2 = ans1[num1:len(ans1)-1]

num = len(ans2)

print(ans2[(m-num1)%num])


Fixed submission:
n,m  = map(int,input().split())
a = [int(x) for x in input().split()]

ans1 = [1]
temp = 0
visit = [0]*(n+1)
visit[1] = 1
while(True):
    ans1 += [a[temp]]

    if visit[a[temp]] == 1:
        break

    visit[a[temp]] = 1
    temp = a[temp]-1


    if len(ans1) == m+1:
        print(ans1[len(ans1)-1])
        exit()


num1 = ans1.index(a[temp])
ans2 = ans1[num1:len(ans1)-1]

num = len(ans2)

print(ans2[(m-num1)%num])
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
H = [int(i) for i in input().split()]

a = [0] * m
b = [0] * m

ans = [1]* n



for i in range(m):
    a[i], b[i] = map(int, input().split())

for i in range(n):

    for j in range(m):
        if a[j] == i+1 and H[i] <= H[b[j]-1]:
            ans[i] = 0
            break
        elif b[j] == i+1 and H[i] <=  H[a[j]-1]:
            ans[i] = 0
            break

print(ans.count(1))


Fixed submission:
n,m = map(int,input().split())
H = [int(i) for i in input().split()]

a = [0] * m
b = [0] * m
ans = [1]* n



for i in range(m):
    a[i], b[i] = map(int, input().split())


for j in range(m):
    if H[a[j]-1] < H[b[j]-1]:
        ans[a[j]-1] = 0
    elif H[a[j]-1] > H[b[j]-1]:
        ans[b[j]-1] = 0
    elif H[a[j]-1] == H[b[j]-1]:
        ans[a[j]-1] = 0
        ans[b[j]-1] = 0


print(ans.count(1))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
H = [int(i) for i in input().split()]

a = [0] * m
b = [0] * m

ans = [1]* n



for i in range(m):
    a[i], b[i] = map(int, input().split())

for i in range(n):

    for j in range(m):
        if a[j] == i+1 and H[i] <= H[b[j]-1]:
            ans[i] = 0
        elif b[j] == i+1 and H[i] <=  H[a[j]-1]:
            ans[i] = 0
    #for k in range(m):
        #print(i)
        #print(a[k])
        #if b[k] == i and H[i-1] > H[a[k]-1]:
        #    ans[i-1] = 0





print(ans.count(1))


Fixed submission:
n,m = map(int,input().split())
H = [int(i) for i in input().split()]

a = [0] * m
b = [0] * m
ans = [1]* n



for i in range(m):
    a[i], b[i] = map(int, input().split())


for j in range(m):
    if H[a[j]-1] < H[b[j]-1]:
        ans[a[j]-1] = 0
    elif H[a[j]-1] > H[b[j]-1]:
        ans[b[j]-1] = 0
    elif H[a[j]-1] == H[b[j]-1]:
        ans[a[j]-1] = 0
        ans[b[j]-1] = 0


print(ans.count(1))
Buggy python submission (verdict: Time Limit Exceeded):
n,m,q = map(int,input().split())
a = [0] * q
b = [0] * q
c = [0] * q
d = [0] * q
for i in range(q):
    a[i], b[i], c[i], d[i]= map(int, input().split())

s = [1] * n
#st[b[i]] - st[a[i]]  = c[i]
num = n-1
ans1 = [0] * 100000000
ans = 0
t = 0

while(s[0] != m):

    for i in range(q):
        if s[b[i]-1] - s[a[i]-1]  == c[i]:
            ans += d[i]
    #print(s)
    #print(ans)

    ans1[t] = ans
    t += 1

    ans = 0

    if s[num] < m:
        s[num] += 1
    elif num > 0 :
        num -= 1
        temp = s[num]+1
        if temp < m:
            for i in range(num,n):
                s[i] = temp
        else:
            while(s[num] == m):
                num -= 1
            temp = s[num]+1
            for i in range(num,n):
                s[i] = temp

        num = n-1






print(max(ans1))


Fixed submission:
n,m,q = map(int,input().split())
a = [0] * q
b = [0] * q
c = [0] * q
d = [0] * q
for i in range(q):
    a[i], b[i], c[i], d[i]= map(int, input().split())

s = [1] * n
#st[b[i]] - st[a[i]]  = c[i]
num = n-1
#ans1 = [0] * 10000000
ans = 0
pre_ans = 0
t = 0

while(s[0] != m ):

    for i in range(q):
        if s[b[i]-1] - s[a[i]-1]  == c[i]:
            ans += d[i]
    #print(s)
    #print(ans)
    ans = max(pre_ans,ans)
    pre_ans = ans
    #t += 1

    ans = 0

    if s[num] < m:
        s[num] += 1
    elif num > 0 :
        num -= 1
        temp = s[num]+1
        if temp < m:
            for i in range(num,n):
                s[i] = temp
        else:
            while(s[num] == m):
                num -= 1
            temp = s[num]+1
            for i in range(num,n):
                s[i] = temp

        num = n-1

for i in range(q):
    if s[b[i]-1] - s[a[i]-1]  == c[i]:
        ans += d[i]

ans = max(pre_ans,ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

def main():

    a,b,n = map(int,input().split())

    if n < b:
        print((a*n)//b)
        exit()

    num = n//b
    ans = 0

    for i in range(1,num+1):
        num2 = i*b-1
        #print(num2)
        temp = (a*num2)//b - a * (num2//b)
        ans = max(temp,ans)

    print(max(ans,(a*n)//b - a * (n//b)))

if __name__ == '__main__':
    main()


Fixed submission:
import sys
input = sys.stdin.readline

def main():

    a,b,n = map(int,input().split())

    if n < b:
        print((a*n)//b)
        exit()

    num = n//b

    ans = (a*(b-1))//b
    print(max(ans,(a*n)//b - a * (n//b)))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


a,b,n = map(int,input().split())


if n < b:
    print((a*n)//b)
    exit()

num = n//b
ans = 0

for i in range(1,num+1):
    num2 = i*b-1
    #print(num2)
    temp = (a*num2)//b - a * (num2//b)
    ans = max(temp,ans)

print(max(ans,(a*n)//b - a * (n//b)))


Fixed submission:
import sys
input = sys.stdin.readline

def main():

    a,b,n = map(int,input().split())

    if n < b:
        print((a*n)//b)
        exit()

    num = n//b

    ans = (a*(b-1))//b
    print(max(ans,(a*n)//b - a * (n//b)))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = map(int,input().split())


if n < b:
    print((a*n)//b)
    exit()

num = n//b
ans = 0

for i in range(1,num+1):
    num2 = i*b-1
    #print(num2)
    temp = (a*num2)//b - a * (num2//b)
    ans = max(temp,ans)

print(max(ans,(a*n)//b - a * (n//b)))


Fixed submission:
import sys
input = sys.stdin.readline

def main():

    a,b,n = map(int,input().split())

    if n < b:
        print((a*n)//b)
        exit()

    num = n//b

    ans = (a*(b-1))//b
    print(max(ans,(a*n)//b - a * (n//b)))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = map(int,input().split())

if n < b:
    print((a*n)//b)
    exit()

num = n//b
ans = 0

for i in range(1,num+1):
    num2 = i*b-1
    #print(num2)
    temp = (a*num2)//b - a * (num2//b)
    ans = max(temp,ans)



print(max(ans,(a*n)//b - a * (n//b)))


Fixed submission:
import sys
input = sys.stdin.readline

def main():

    a,b,n = map(int,input().split())

    if n < b:
        print((a*n)//b)
        exit()

    num = n//b

    ans = (a*(b-1))//b
    print(max(ans,(a*n)//b - a * (n//b)))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import copy

n = int(input())
s = []
for _ in range(n):
    s.append(input())

s2 = copy.copy(s)
i = n
j = 0#何個かぶったか
sum2 = 0
sum1 = 0

for k in range(i):
    for l in range(k,i):
        if s[k] == s[l]:
            
            j += 1
            s2.remove(s[k])
        
    if j == 1:
      j = 0
      s2 = [s[k]] + s2
      sum2 += 1
      sum1 += 1
    else:
      temp = s[k]
      s = [temp]  + copy.copy(s2)
      s2 = copy.copy(s)
      i -= (j-1)
      sum2 += j
      sum1 += 1
      j = 0

    if sum2 == n:
      break
          
#sum1 = len(s)
print(sum1)


Fixed submission:
n = int(input())
s = []
for _ in range(n):
    s.append(input())

s2 = list(set(s))


print(len(s2))

Buggy python submission (verdict: Time Limit Exceeded):
import copy

n = int(input())
s = []
for _ in range(n):
    s.append(input())

s2 = copy.copy(s)
i = n
j = 0#何個かぶったか
sum2 = 0

for k in range(i):
    #temp = s[k]
    for l in range(i):
        if s[k] == s[l]:
            
            j += 1
            s2.remove(s[k])
           
    if j == 1:
      j = 0
      s2 = [s[k]] + s2
      sum2 += 1
    else:
      #print(j)
      temp = s[k]
        #for m in range(j):
            #s.remove(temp)

      s = [temp]  + copy.copy(s2)
      s2 = copy.copy(s)
      i -= (j-1)
      sum2 += j
      j = 0

    if sum2 == n:
      break
          
sum1 = len(s)
print(sum1)

Fixed submission:
n = int(input())
s = []
for _ in range(n):
    s.append(input())

s2 = list(set(s))


print(len(s2))

Buggy python submission (verdict: Time Limit Exceeded):
import copy

n = int(input())
s = []
for _ in range(n):
    s.append(input())

s2 = copy.copy(s)
i = n
j = 0#何個かぶったか
sum2 = 0

for k in range(i):
    #temp = s[k]
    for l in range(i):
        if s[k] == s[l]:
            
            j += 1
            s2.remove(s[k])
           
    if j == 1:
      j = 0
      s2 = [s[k]] + s2
      sum2 += 1
    else:
      #print(j)
      temp = s[k]
        #for m in range(j):
            #s.remove(temp)

      s = [temp]  + copy.copy(s2)
      s2 = copy.copy(s)
      i -= (j-1)
      sum2 += j
      j = 0

    if sum2 == n:
      break
          
sum1 = len(s)
print(sum1)

Fixed submission:
n = int(input())
s = []
for _ in range(n):
    s.append(input())

s2 = list(set(s))


print(len(s2))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for _ in range(n):
    s.append(input())


i = n#
j = 0#何個かぶったか

sum2 = 0


for k in range(i):
    for l in range(i):
        if s[k] == s[l]:
            j += 1
            
    if j == 1:
      j = 0
      sum2 += 1
    else:
        temp = s[k]
        for m in range(j):
            s.remove(temp)
        s = [temp]  + s

        i -= (j-1)
        sum2 += j
        j = 0

    if sum2 == n:
      break
          

sum1 = len(s)
print(sum1)


Fixed submission:
n = int(input())
s = []
for _ in range(n):
    s.append(input())

s2 = list(set(s))


print(len(s2))
Buggy python submission (verdict: Runtime Error):

n = int(input())
c = list(input())

r = c.count("R")
g = c.count("G")
b = c.count("B")

ans = r*g*b
count  = 0
sub1 = 0

for i in range(n):
    for j in range(i+1,n):
        if 2*j-i >= n or 2*j-i <0:
            break
        elif c[2*j-i] != c[i] and c[i] != c[j] and c[2*j-i] != c[j]:
                sub1 += 1


print(ans-sub1)


Fixed submission:
N = int(input());

if N%10 == 7:
  print("Yes")
elif (N - N%10)%100 == 70:
  print("Yes")
elif (N - N%100) == 700:
  print("Yes") 
else :
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
c = list(input())

deta = list(range(n))
r = c.count("R")
g = c.count("G")
b = c.count("B")

ans = r*g*b

count  = 0

sub1 = 0

for i in range(n):
    for j in range(i,n):
        if 2*j-i<n and 2*j-i>0:
            if c[2*j-i] != c[i] and c[i] != c[j] and c[2*j-i] != c[j]:
                sub1 += 1


print(ans-sub1)


Fixed submission:
n = int(input())
c = list(input())

r = c.count("R")
g = c.count("G")
b = c.count("B")

ans = r*g*b
count  = 0
sub1 = 0

for i in range(n):
    for j in range(i+1,n):
        if 2*j-i >= n or 2*j-i <0:
            break
        elif c[2*j-i] != c[i] and c[i] != c[j] and c[2*j-i] != c[j]:
                sub1 += 1


print(ans-sub1)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
c = list(input())

deta = list(range(n))

lis = list(itertools.combinations(deta,2))

count  = 0

for i in lis:
    if c[i[0]] != c[i[1]]:
        for j in range(i[0]+1,i[1]):
            if j-i[0] != i[1]-j and c[i[0]] != c[j] and c[j] != c[i[1]]:
                count += 1

print(count)


Fixed submission:
n = int(input())
c = list(input())

r = c.count("R")
g = c.count("G")
b = c.count("B")

ans = r*g*b
count  = 0
sub1 = 0

for i in range(n):
    for j in range(i+1,n):
        if 2*j-i >= n or 2*j-i <0:
            break
        elif c[2*j-i] != c[i] and c[i] != c[j] and c[2*j-i] != c[j]:
                sub1 += 1


print(ans-sub1)
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
a = [int(x) for x in input().split()]

deta = [0] * (n+1)

for i in a:
    deta[i] += 1

ans = [0] * (n+1)

for j in range(n+1):
    if deta[j] > 1:
        ans[j] = deta[j]*(deta[j]-1)/2
    else :
        ans[j] = 0

for k in a:
    if deta[k] == 2:
        print(int(sum(ans) - 1))
    elif deta[k] == 1:
        print(int(sum(ans)))
    else:
        print(int(sum(ans) - deta[k]*(deta[k]-1)/2 + (deta[k]-1)*(deta[k]-2)/2))


Fixed submission:

n = int(input())
a = [int(x) for x in input().split()]

deta = [0] * (n+1)

for i in a:
    deta[i] += 1

ans = [0] * (n+1)

for j in range(n+1):
    if deta[j] > 1:
        ans[j] = deta[j]*(deta[j]-1)/2
    else :
        ans[j] = 0

add = sum(ans)

for k in a:
    print(int(add - deta[k]*(deta[k]-1)/2 + (deta[k]-1)*(deta[k]-2)/2))
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n%2 = 0:
    ans = n//2
else:
    ans = (n+1)//2

print(ans)ß

Fixed submission:
n = int(input())

if n%2 == 0:
    ans = n//2
else:
    ans = (n+1)//2

print(ans)
Buggy python submission (verdict: Runtime Error):
s,t = input().split()
a,b = map(int,input().split()
u = input()
          
if u == s:
	print(a-1,b)
elif u == t:
    print(a,b-1)
else:
    print(a,b)

Fixed submission:
s,t = input().split()
a,b = map(int,input().split())
u = input()
          
if u == s:
	print(a-1,b)
elif u == t:
    print(a,b-1)
else:
    print(a,b)
Buggy python submission (verdict: Runtime Error):
d, t, s = map(int, input().split( ))
if d/s <= t:
    print(Yes)
else:
    print(No) 


Fixed submission:
d, t, s = map(int, input().split( ))
if d/s <= t:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
d, t, s = map(int, input().split())
if s * t => d
    print(Yes)
else:
    print(No) 


Fixed submission:
d, t, s = map(int, input().split( ))
if d/s <= t:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
d, t, s = map(int, input().split())
if s * d => t
    print(Yes)
else:
    print(No) 


Fixed submission:
d, t, s = map(int, input().split( ))
if d/s <= t:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
d, t, s = map(int, input().split())
if d/s <= t:
    print(Yes)
else:
    print(No) 


Fixed submission:
d, t, s = map(int, input().split( ))
if d/s <= t:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N, X, T = map(int, input())
import math
number_of_times = math.ceil(N/X)
total_time = T * number_of_times
print(number_of_times)


Fixed submission:
N, X, T = map(int, input().split())
import math
number_of_times = math.ceil(N/X)
total_time = T * number_of_times
print(total_time)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1

if 0 in a: print('0')
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            print(-1)
        break
    print(ans)


Fixed submission:
a, b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1

for i in range(n):
    if 0 in a:
        ans = 0
        break
    
    ans *= a[i]
    if ans > 10**18:
        ans = -1
        break

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1

if 0 in a:
    ans = 0
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            ans = -1
            break

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
if s = 'ABC':
    print('ARC')
else:
    print('ABC')

Fixed submission:
s = input()
if s == 'ABC':
    print('ARC')
else:
    print('ABC')
Buggy python submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input().split())
if a % k == 0:
    print('OK')
elif (b-a) // k >= 1:
    print('OK')
else:
    print(NG)

Fixed submission:
k = int(input())
a, b = map(int, input().split())
if b // k - a // k > 0:
    print('OK')
elif a % k == 0:
    print('OK')
else:
    print('NG')
Buggy python submission (verdict: Runtime Error):
S = input()
if S[3] == S[4] and S[5] == S[6]:
    print('Yes')
else:
    print('No')

Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')