Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
ab = input()
a,b = ab.split()
a = int(a)
b = int(b)
 
if a%2 == 1 and b%2 == 1:
  print(Yes)
else:
  print(No)

Fixed submission:
ab = input()
a,b = ab.split()
a = int(a)
b = int(b)
 
if a%2 == 1 and b%2 == 1:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
k = int(input())
print(int((k/2)**2)) if k%2 == 0 else print(int(k/2)**2 - 1/4))


Fixed submission:
k = int(input())
print(int((k/2)**2)) if k%2 == 0 else print(int((k/2)**2 - 1/4))
Buggy python submission (verdict: Runtime Error):
n = int(input())
an = input()
an = an.split()

dif = 999999999

for i in range(n-1):
    for r in range(i+1, n):
        a = int(an[i])
        b = int(an[r])

        abs = abs(a-b)
        if abs < dif:
            dif = abs

print(dif)


Fixed submission:
n = input()
an = input()
an = an.split()
list = []

for i in an:
    i = int(i)
    list.append(i)
min_an = min(list)
max_an = max(list)

print(max_an - min_an)

Buggy python submission (verdict: Runtime Error):
n = int(input())
an = input()
an = an.split()

dif = 10000000000

for i in range(n-1):
    for r in range(i+1, n):
        a = int(an[i])
        b = int(an[r])

        abs = abs(a-b)
        if abs < dif:
            dif = abs

print(dif)


Fixed submission:
n = input()
an = input()
an = an.split()
list = []

for i in an:
    i = int(i)
    list.append(i)
min_an = min(list)
max_an = max(list)

print(max_an - min_an)
Buggy python submission (verdict: Runtime Error):
from math import floor
nk = input()
n, k = nk.split()
n = int(n)
k = int(k)

an = input()
an_list = an.split()
min = min(an_list)

min_ind = an_list.index(min) + 1
after = (n - min_ind) / (k-1)
before = (min_ind - 1) / (k-1)

res = 0

if min_ind < k or (n - min_ind) > (k-1):
    res = floor(n/(k-1)) 

else:
    if after.is_integer():
    res = res + after
    else:
    res = res + floor(after) + 1

    if before.is_integer():
    res = res + before
    else:
    res = res + floor(before) + 1


print(int(res))

Fixed submission:
N, K = map(int,input().split())
A = list(map(int, input().split()))
if (N-1) % (K-1) == 0:
	print((N-1)//(K-1))
else:
  	print((N-1)//(K-1)+1)
Buggy python submission (verdict: Runtime Error):
A = int(input ())
B = int (input ())
if A > 8 or B > 8: 
    res = ‘: (‘
 
else:
    res = ‘Yay!’
 
print(res)

Fixed submission:
ab = input()
a, b = ab.split()
A = int(a)
B = int (b)
if A > 8 or B > 8:
    res = ':('

else:
    res = 'Yay!'

print(res)

Buggy python submission (verdict: Runtime Error):
A = int(input ())
B = int (input ())
if A > 8 or B > 8: 
    res = ‘: (‘

else:
    res = ‘Yay!’

print(res)

Fixed submission:
ab = input()
a, b = ab.split()
A = int(a)
B = int (b)
if A > 8 or B > 8:
    res = ':('

else:
    res = 'Yay!'

print(res)
Buggy python submission (verdict: Runtime Error):
dn = input()
d, n = dn.split()
d = int(d)
n = int(n)
list = []
for i in range(1, 1000001):
    if i% 100**d:
        list.append(i)

print(list[n+1])


Fixed submission:
d,n = map(int, input().split())
if n == 100:
    print(100**d * 101)
else:
    print(100**d * n)

Buggy python submission (verdict: Runtime Error):
n = int(input())
line = input()
liststr = line.split()
list = []

for i in liststr:
    i = int(i)
    list.append(i)


cc = 0
for r in list:
    while r%2 == 0:
        r = r / 2
        cc = cc + 1


print(cc)


Fixed submission:
d,n = map(int, input().split())
if n == 100:
    print(100**d * 101)
else:
    print(100**d * n)
Buggy python submission (verdict: Runtime Error):
ｆｇｈｊ

Fixed submission:
n = int(input())
if n<1000:
    print('ABC')
else:
    print('ABD')
Buggy python submission (verdict: Runtime Error):
n = int(input())
list = []

while n > 9**5:
    n = n - 9**5
    list.append(g)

while n > 6**6:
    n = n - 6**6
    list.append(g)


while n > 6**5:
    n = n - 6**5
    list.append(g)


for i in [4,3,2,1]:

    for r in [9,6,]:
        while n > r**i:
            n = n - r**i
            list.append(r**i)



length = len(list) + n
print(length)



Fixed submission:
n = int(input())
res = n
ans = 0
for i in range(n+1):
    t = i
    cc = 0
    while t >= 1:
        cc = cc + t % 6
        t = t // 6

    t = n-i
    while t >= 1:
        cc = cc + t%9
        t = t // 9


    if res > cc:
        res = cc

print(res)
Buggy python submission (verdict: Runtime Error):
ab_str = input()
a_str, b_str = ab_str.split()
a = int(a_str)
b = int(b_str)
if a%2 == 0 or b%2 == 0:
  print(Even)
else:
  print(Odd)

Fixed submission:
ab_str = input()
a_str, b_str = ab_str.split()
a = int(a_str)
b = int(b_str)
if a%2 == 0 or b%2 == 0:
    print('Even')
else:
    print('Odd')
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(len(list(set(map(int, input() for i in range(n))))))

Fixed submission:
n = input()
n = int(n)
s = set([])

for i in range(1, n+1):
    a = input()
    a = int(a)
    s.add(a)

print(len(s))

Buggy python submission (verdict: Runtime Error):
n = int(input())
list = input().split()
print(list(set(list)))

Fixed submission:
n = input()
n = int(n)
s = set([])

for i in range(1, n+1):
    a = input()
    a = int(a)
    s.add(a)

print(len(s))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 0
for i in range(1, n+1):
    sum = sum(list(map(int, list(str(i)))))
    if a<= sum <=b:
        ans+=i

print(ans)


Fixed submission:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l0 = 2
l1 = 1
for i in range(n-1):
    l = l0 + l1
    l0 = l1
    l1 = l

print(l)


Fixed submission:
n = int(input())
l0 = 2
l1 = 1
for i in range(n-1):
    l = l0 + l1
    l0 = l1
    l1 = l
if n == 1:
    print(l1)
else:
    print(l)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = []
start = 1

for i in range(k):
  start *= a[i]
  
b.append(start)

score = start

for i in range(k, n):
  score = score / a[i-k] * a[i]
  b.append(score)
  
for i in range(n-k):
  if b[i] < b[i + 1]:
    print('Yes')
  else:
    print('No')

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

for i in range(n - k):
  if a[i] < a[i + k]:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
d = 4 * a * b
e = (c - a - b) * (c - a - b)
if d < e && 0 < (c - a - b):
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c = map(int,input().split())
d = 4 * a * b
e = (c - a - b) * (c - a - b)
if d < e and 0 < (c - a - b):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math


def inp():
    return(int(input()))


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


n = inp()
arr = invr()
arr = sorted(arr)
max = arr[n-1]
min = arr[0]

cost = math.inf
for p in range(min, max+1):
    temp_cost = 0
    for xi in arr:
        temp_cost += (xi-p)**2
    if temp_cost < cost:
        cost = temp_cost
print(cost)


Fixed submission:
import math


def inp():
    return(int(input()))


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


n = inp()
arr = invr()
arr = sorted(arr)
max = arr[n-1]
min = arr[0]

cost = 100000000000
for p in range(min, max+1):
    temp_cost = 0
    for xi in arr:
        temp_cost += (xi-p)**2
    if temp_cost < cost:
        cost = temp_cost
print(cost)

Buggy python submission (verdict: Runtime Error):
import math


def inp():
    return(int(input()))


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


n = inp()
arr = invr()
arr = sorted(arr)
max = arr[n-1]
min = arr[0]

cost = math.inf
for p in range(min, max+1):
    temp_cost = 0
    for xi in arr:
        temp_cost += (xi-p)**2
    if temp_cost < cost:
        cost = temp_cost
print(cost)


Fixed submission:
import math


def inp():
    return(int(input()))


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


n = inp()
arr = invr()
arr = sorted(arr)
max = arr[n-1]
min = arr[0]

cost = 100000000000
for p in range(min, max+1):
    temp_cost = 0
    for xi in arr:
        temp_cost += (xi-p)**2
    if temp_cost < cost:
        cost = temp_cost
print(cost)
Buggy python submission (verdict: Time Limit Exceeded):
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


n = inp()
P = inlist()
c = 0
for i in range(n):
    f = True
    for j in range(i):
        if P[j] < P[i]:
            f = False
            break
    if f:
        c += 1
print(c)


Fixed submission:
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N = inp()
P = inlist()
c = 0
m = 200000000

for i in range(N):
    if P[i] < m:
        m = P[i]
    if m >= P[i]:
        c += 1


print(c)
Buggy python submission (verdict: Time Limit Exceeded):
# For taking integer inputs.
import math
from decimal import Decimal
from itertools import permutations


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


n = inp()
a = inlist()
D = 10000000000000000
mid = 0
for i in range(1, n):

    s1 = sum(a[:i])
    s2 = sum(a[i:])

    d = abs(s1 - s2)

    if d < D:
        mid = i
        D = d
s1 = sum(a[:mid])
s2 = sum(a[mid:])
res = abs(s1-s2)
print(res)


Fixed submission:
# For taking integer inputs.
import math
from decimal import Decimal
from itertools import permutations


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


n = inp()
a = inlist()
pref = [0] * (n)
suf = [0] * n
pref[0] = a[0]
suf[n-1] = a[n-1]
j = n - 2
for i in range(1, n):
    pref[i] = a[i] + pref[i-1]
    suf[j] = a[j] + suf[j+1]
    j -= 1

D = 10000000000000000
for i in range(0, n-1):

    s1 = pref[i]
    s2 = suf[i+1]
    d = abs(s1 - s2)
    if d < D:

        D = d

print(D)
Buggy python submission (verdict: Time Limit Exceeded):
# For taking integer inputs.
import math


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


def getCount(start):
    l = r = 0
    for i in range(start-1, -1, -1):
        if a[i] == "<":
            l += 1
        else:
            break
    for i in range(start, n):
        if a[i] == ">":
            r += 1
        else:
            break

    return max(l, r)


a = input()
n = len(a)
c = 0
total = 0
flip = a[0]
for i in range(n+1):
    temp = getCount(i)
    total += temp
print(total)


Fixed submission:
# For taking integer inputs.
import math


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


a = input()
n = len(a)
coutn1 = [0] * (n+1)
coutn2 = [0] * (n+1)

for i in range(n):
    if a[i] == "<":
        coutn1[i+1] = coutn1[i] + 1
for i in range(n-1, -1, -1):
    if a[i] == ">":
        coutn2[i] = coutn2[i+1] + 1

total = 0

for i in range(n+1):
    total += max(coutn1[i], coutn2[i])
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N, K, Q = invr()
S = [K] * (N+1)

for i in range(1, Q+1):
    a = inp()
    for j in range(1, N+1):
        if j != a:
            S[j] -= 1
for i in range(1, N+1):
    if S[i] > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N, K, Q = invr()
S = [K] * (N+1)
t = 0
for i in range(1, Q+1):
    a = inp()
    S[a] += 1
    t += 1

for i in range(1, N+1):
    if S[i] - t > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N, K, Q = invr()
S = [K] * (N+1)
A = []
for i in range(1, Q+1):
    a = inp()
    for j in range(1, N+1):
        if j != a:
            S[j] -= 1
for s in S[1:]:
    if s > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N, K, Q = invr()
S = [K] * (N+1)
t = 0
for i in range(1, Q+1):
    a = inp()
    S[a] += 1
    t += 1

for i in range(1, N+1):
    if S[i] - t > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N = inp()

A = inlist()
m = 0
for i in range(N):
    c = 0
    for j in range(i, N-1):
        if A[j] >= A[j+1]:
            c += 1
        else:
            break
    if c > m:
        m = c
print(m)


Fixed submission:
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N = inp()

A = inlist()
move = 0
m = 0
current = A[0]
for i in range(1, N):

    if A[i] <= current:
        m += 1
    else:
        m = 0
    if move < m:
        move = m
    # print(current, A[i], m, move)
    current = A[i]


print(move)
Buggy python submission (verdict: Time Limit Exceeded):
# For taking integer inputs.
def inp():
    return(int(input()))


N = inp()
A = []
for i in range(N):
    A.append(inp())

for i in range(N):
    temp = A[i]
    A[i] = 0
    print(max(A))
    A[i] = temp


Fixed submission:
# For taking integer inputs.
def inp():
    return(int(input()))


N = inp()
A = []
i1, i2 = 0, 0

for i in range(N):
    A.append(inp())

srt = sorted(A)
m1 = srt[-1]
m2 = srt[-2]

for i in range(N):
    if A[i] == m1:
        print(m2)
    else:
        print(m1)
Buggy python submission (verdict: Time Limit Exceeded):
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (
    acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians,
    sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits


def inp():
    return(int(input()))


def inlist():
    return(list(map(int, input().split())))


def instr():
    s = input()
    return(list(s[:len(s)]))


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


n, k = invr()
res = Decimal(0)
for i in range(1, n+1):
    if i >= (k-1):
        res += Decimal(1/n)
    else:
        x = int(ceil(log2((k)/i)))
        res += Decimal((1/n) * (1/2)**x)
print(res)


Fixed submission:
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (
    acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians,
    sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits


def inp():
    return(int(input()))


def inlist():
    return(list(map(int, input().split())))


def instr():
    s = input()
    return(list(s[:len(s)]))


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


n, k = invr()
res = 0
for i in range(1, n+1):
    if i > (k-1):
        res += 1/n
    else:
        x = ceil(log2((k)/i))
        res += (1/n) * (1/2)**x
print(res)
Buggy python submission (verdict: Runtime Error):
# For taking integer inputs.
import math


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


a = input()
k = inp()
i = 0
while a[i] == '1':
    i += 1

if i >= k:
    print(1)
elif len(a) == i:
    print(1)
else:
    print(a[i])


Fixed submission:
# For taking integer inputs.
import math


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


a = input()
k = inp()
i = 0
while i < len(a) and a[i] == '1':
    i += 1

if i >= k:
    print(1)
elif len(a) == i:
    print(1)
else:
    print(a[i])
Buggy python submission (verdict: Time Limit Exceeded):
# For taking integer inputs.
import math


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N = inp()
a = inlist()
c = 0
while True:
    done1 = 0
    for i in range(N):
        if a[i] % 2 == 0 and done1 == 0:
            a[i] = a[i] // 2
            done1 = 1
            c += 1
        else:
            a[i] *= 3
    if done1 == 0:
        break

print(c)


Fixed submission:
# For taking integer inputs.
import math


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


def getn(n):
    c = 0
    while n % 2 == 0:
        n = n // 2
        c += 1
    return c


N = inp()
a = inlist()
c = 0
for i in a:
    c += getn(i)

print(c)