Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = list(input())
n = len(s)
s_half = (n - 1)/2
s_3 = (n + 3)/ 2
if s == s[::-1]:
	if s[s_half - 1] == s[s_half - 1::-1]:
		if s[s_3 -1] == s[s_3 -1::-1]:
			print('Yes')
print('No')



Fixed submission:
s = input()
l = len(s)
if list(s) != list(reversed(s)):
    print('No')
    exit()
if list(s[:(l - 1) // 2]) != list(reversed(s[:(l - 1) // 2])):
    print('No')
    exit()
if list(s[(l + 3) // 2 -1:l]) != list(reversed(s[(l + 3) // 2 -1:l])):
    print('No')
    exit()
print('Yes')

Buggy python submission (verdict: Runtime Error):
s = list(input())
n = len(s)
s_half = (n - 1)/2
s_3 = (n + 3)/ 2
if s == s[::-1]:
	if s_half == s_half[::-1]:
		if s_3 == s_3[::-1]:
			print('Yes')
print('No')

Fixed submission:
s = input()
l = len(s)
if list(s) != list(reversed(s)):
    print('No')
    exit()
if list(s[:(l - 1) // 2]) != list(reversed(s[:(l - 1) // 2])):
    print('No')
    exit()
if list(s[(l + 3) // 2 -1:l]) != list(reversed(s[(l + 3) // 2 -1:l])):
    print('No')
    exit()
print('Yes')
Buggy python submission (verdict: Runtime Error):
a, b, c  = list(map(int, input().split()))
if len(set(a)) == 2:
    print('Yes')
else:
    print('No')

Fixed submission:
a = list(map(int, input().split()))
if len(set(a)) == 2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(s - 1 , t)
else:
    print(s, t - 1)

Fixed submission:
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(a - 1 , b)
else:
    print(a, b - 1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int, input().split()))
ans = 0
for i in n -1:
	for j in (i + 1: n):
		ans += d[i] * d[j]
		
print(ans)

Fixed submission:
n = int(input())
d = list(map(int, input().split()))
ans = 0
for i in range(n -1):
	for j in range(i + 1, n):
		ans += d[i] * d[j]
		
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int, input().split()))
ans = 0
for i in d:
	for j in (d -i):
		ans += i * j
		
print(ans // 2)

Fixed submission:
n = int(input())
d = list(map(int, input().split()))
ans = 0
for i in range(n -1):
	for j in range(i + 1, n):
		ans += d[i] * d[j]
		
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
for i in range(3):
	if s[i] == t[i]:
		ans += 1
		
print(ans)

Fixed submission:
s = input()
t = input()
ans = 0
for i in range(3):
	if s[i] == t[i]:
		ans += 1
		
print(ans)
Buggy python submission (verdict: Runtime Error):
a = input().split()
s = input()
if a >= 3200:
	print(s)
else:
	print('Red')

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
	print(s)
else:
	print('red')
Buggy python submission (verdict: Runtime Error):
a, b = amp(int, input().split())
c = a * b
if(c % 2):
    print("Odd")
else:
    print("Even")

Fixed submission:
a, b = map(int, input().split())
c = a * b
if(c % 2):
    print("Odd")
else:
    print("Even")
Buggy python submission (verdict: Runtime Error):
import sys
S=""
S=sys.argv[1]
len(S)<=1000
if S[-1] == 's':
   S=S+'es'
else:
	S=S+'s'
print(S)

Fixed submission:
S=input()
if S[-1] == 's':
	S=S+'es'
else:
	S=S+'s'
print(S)

Buggy python submission (verdict: Runtime Error):
import sys
S=""
S=sys.argv[1]
if S[-1] == 's':
   S=S+'es'
else:
	S=S+'s'
print(S)


Fixed submission:
S=input()
if S[-1] == 's':
	S=S+'es'
else:
	S=S+'s'
print(S)

Buggy python submission (verdict: Runtime Error):
import sys
S=""
S=sys.argv[1]
if S[-1] == 's':
   S=S+'es'
else:
	S=S+'s'
print(S)


Fixed submission:
S=input()
if S[-1] == 's':
	S=S+'es'
else:
	S=S+'s'
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
n=0
W=0
n,W=map(int,input().split())
dp=[W+1]*(101010)
dp[0]=0
for i in range(n):
    w,v=map(int,input().split())
    j=100000
    while j>=0:
        if dp[j+v]>dp[j]+w:
            dp[j+v]=dp[j]+w
        j-=1
ans=0
for v in range(len(dp)):
    if dp[v]<=W:
        ans=v
print(ans)

Fixed submission:
n=0
W=0
n,W=map(int,input().split())
dp=[W+1]*101010
dp[0]=0
for i in range(n):
    w,v=map(int,input().split())
    j=100000
    while j>=0:
        if dp[j+v]>dp[j]+w:
            dp[j+v]=dp[j]+w
        j-=1
ans=0
for v in range(len(dp)):
    if dp[v]<=W:
        ans=v
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    sum = 0
    for i in range(0, N - 1):
        for j in range(i + 1, N):
            sum += (A[i] * A[j])
    sum = sum % (10 ** 9 + 7)

    print(sum)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    B = sum(A)
    answer = 0
    for i in range(0, N):
        answer += A[i] * (B - A[i])
        B -= A[i]

    answer %= (10 ** 9 + 7)

    print(answer)


if __name__ == "__main__":
    main()

# A1*A2 + A1*A3 + ... + A1*AN = A1 * (A2 + A3 + ... + AN)
# +
# A2*A3 + A2*A4 + ... +| A2*AN = A2 * (A3 + A4 + ... + AN)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    sum = 0
    for i in range(0, N - 1):
        for j in range(i + 1, N):
            sum += (A[i] * A[j])
        sum = sum % (10 ** 9 + 7)

    print(sum)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    B = sum(A)
    answer = 0
    for i in range(0, N):
        answer += A[i] * (B - A[i])
        B -= A[i]

    answer %= (10 ** 9 + 7)

    print(answer)


if __name__ == "__main__":
    main()

# A1*A2 + A1*A3 + ... + A1*AN = A1 * (A2 + A3 + ... + AN)
# +
# A2*A3 + A2*A4 + ... +| A2*AN = A2 * (A3 + A4 + ... + AN)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    sum = 0
    for i in range(0, N - 1):
        for j in range(i + 1, N):
            sum += (A[i] * A[j])
            sum = sum % (10 ** 9 + 7)

    print(sum)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    B = sum(A)
    answer = 0
    for i in range(0, N):
        answer += A[i] * (B - A[i])
        B -= A[i]

    answer %= (10 ** 9 + 7)

    print(answer)


if __name__ == "__main__":
    main()

# A1*A2 + A1*A3 + ... + A1*AN = A1 * (A2 + A3 + ... + AN)
# +
# A2*A3 + A2*A4 + ... +| A2*AN = A2 * (A3 + A4 + ... + AN)
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    ans = ''

    while N > 0:
        N -= 1
        ans += chr(ord('a') + N % 26).lower()
        N = N // 26
    print(ans[::-1])


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    alpha = input()
    if alpha.isupper():
        print('A')
    else:
        print('a')


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())
    BC = [list(map(int, input().split())) for i in range(Q)]

    g = {}
    for a in A:
        if a not in g:
            g[a] = 1
        else:
            g[a] += 1

    for i in range(Q):
        B, C = tuple(BC[i])
        if B in g:
            t = g.pop(B)
            if C in g:
                g[C] += t
            else:
                g[C] = t
        ans = 0
        for k, v in g.items():
            ans += k * v
        print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())
    BC = [list(map(int, input().split())) for i in range(Q)]

    g = {}
    ans = 0
    for a in A:
        ans += a
        if a not in g:
            g[a] = 1
        else:
            g[a] += 1

    for i in range(Q):
        B, C = tuple(BC[i])
        if B in g:
            t = g.pop(B)
            ans += t * (C - B)
            if C in g:
                g[C] += t
            else:
                g[C] = t
        print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())
    BC = [list(map(int, input().split())) for i in range(Q)]

    for i in range(Q):
        B, C = tuple(BC[i])
        for j in range(N):
            if A[j] == B:
                A[j] = C
        print(sum(A))


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())
    BC = [list(map(int, input().split())) for i in range(Q)]

    g = {}
    ans = 0
    for a in A:
        ans += a
        if a not in g:
            g[a] = 1
        else:
            g[a] += 1

    for i in range(Q):
        B, C = tuple(BC[i])
        if B in g:
            t = g.pop(B)
            ans += t * (C - B)
            if C in g:
                g[C] += t
            else:
                g[C] = t
        print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
a=input()
b = input()
cnt = 0
for i  on range(len(a)):
    if a[i]!=b[i]: cnt+=1
print(cnt)

Fixed submission:
a = input()
b = input()
cnt = 0
for i in range(len(a)):
    if a[i]!=b[i]:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
s = input()
newS = ""

for i in range(len(s)):
    if s[i]=="?" and len(s)!= 1 and i==0 and s[i+1]=="D":
        newS+="P"
    elif len(s)&1 and i==len(s)-1 and s[i]=="?":
        newS+="D"
    elif s[i]=="?":
        if i!=0 and i!=len(s)-1:
            if newS[i-1]=="P":
                newS+="D"
            elif newS[i-1]=="D" and  (s[i+1]=="D" or s[i+1]=="?"):
                newS+="P"
        else:
            if i==0:
                if s[i+1]=="D":
                    newS+="P"
                elif s[i+1]=="P" or s[i+1]=="?":
                    newS+="D"
            else:
                newS+="D"
    else:
        newS+=s[i]
print(newS)


Fixed submission:
s = input()
newS = ""
for i in range(len(s)):
    if s[i]=="?":
        newS+="D"
    else:
        newS+=s[i]
print(newS)

Buggy python submission (verdict: Runtime Error):
s = input()
newS = ""

for i in range(len(s)):
    if s[i]=="?" and len(s)!= 1 and i==0 and s[i+1]=="D":
        newS+="P"
    elif len(s)&1 and i==len(s)-1 and s[i]=="?":
        newS+="D"
    elif s[i]=="?":
        if newS[i-1]=="P":
            newS+="D"
        elif newS[i-1]=="D" and (s[i+1]=="D" or s[i+1]=="?"):
            newS+="P"
    else:
        newS+=s[i]
print(newS)


Fixed submission:
s = input()
newS = ""
for i in range(len(s)):
    if s[i]=="?":
        newS+="D"
    else:
        newS+=s[i]
print(newS)
Buggy python submission (verdict: Runtime Error):
a = "abcdefghijklmnopqrstuvwyz"

s = input()
print(a.index[a.index(s)+1])

Fixed submission:
a = "abcdefghijklmnopqrstuvwyz"

s = input()
print(a[a.index(s)+1])
Buggy python submission (verdict: Runtime Error):
days = ["SUN", "MON", "TUE,","WED", "THU", "FRI", "SAT"]
s = input()
print(7-days.index(s))

Fixed submission:
days = ["SUN", "MON", "TUE","WED", "THU", "FRI", "SAT"]
s = input()
print(7-days.index(s))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k = map(int, input().split())
    results = tuple(map(int, input().split()))

    products = 1
    for result in results[:k]:
        products *= result
    for i in range(n-k):
        new_products = products * results[i+k] / results[i]
        if products < new_products:
            print('Yes')
        else:
            print('No')
        products = new_products


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, k = map(int, input().split())
    results = tuple(map(int, input().split()))

    for i in range(n-k):
        print('Yes' if results[i] < results[i+k] else 'No')



if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k = map(int, input().split())
    results = tuple(map(int, input().split()))

    products = 1
    for result in results[:k]:
        products *= result
    for i in range(n-k):
        new_products = products * results[i+k] / results[i]
        if products < products*results[i+k]/results[i]:
            print('Yes')
        else:
            print('No')
        products = new_products


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, k = map(int, input().split())
    results = tuple(map(int, input().split()))

    for i in range(n-k):
        print('Yes' if results[i] < results[i+k] else 'No')



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

def main():
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())

    a_dict = collections.Counter(a)
    a_dict = {key: key*value for key, value in a_dict.items()}
    for _ in range(q):
        b, c = map(int, input().split())
        if b in a_dict:
            if c in a_dict:
                a_dict[c] += (a_dict.pop(b)//b) * c
            else:
                a_dict[c] = (a_dict.pop(b)//b) * c
        print(sum(a_dict.values()))


if __name__ == '__main__':
    main()


Fixed submission:
import collections

def main():
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())

    a_dict = collections.Counter(a)
    a_dict = {key: key*value for key, value in a_dict.items()}
    answer = sum(a_dict.values())
    for _ in range(q):
        b, c = map(int, input().split())
        diff = 0
        if b in a_dict:
            b_sum = a_dict.pop(b)
            c_add = b_sum//b * c
            diff = c_add - b_sum
            if c in a_dict:
                a_dict[c] += c_add
            else:
                a_dict[c] = c_add
        answer += diff
        print(answer)


if __name__ == '__main__':
    main()

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

def main():
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())

    a_dict = collections.Counter(a)
    a_dict = {key: key*value for key, value in a_dict.items()}
    for _ in range(q):
        b, c = map(int, input().split())
        if b in a_dict:
            if c in a_dict:
                a_dict[c] += (a_dict.pop(b)//b) * c
            else:
                a_dict[c] = (a_dict.pop(b)//b) * c
        print(sum(a_dict.values()))


if __name__ == '__main__':
    main()


Fixed submission:
import collections

def main():
    n = int(input())
    a = list(map(int, input().split()))
    q = int(input())

    a_dict = collections.Counter(a)
    a_dict = {key: key*value for key, value in a_dict.items()}
    answer = sum(a_dict.values())
    for _ in range(q):
        b, c = map(int, input().split())
        diff = 0
        if b in a_dict:
            b_sum = a_dict.pop(b)
            c_add = b_sum//b * c
            diff = c_add - b_sum
            if c in a_dict:
                a_dict[c] += c_add
            else:
                a_dict[c] = c_add
        answer += diff
        print(answer)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a_tuple = tuple(map(int, input().split()))

    answer = 1
    for a in a_tuple:
        answer *= a
    print(answer if answer <= 10**18 else -1)


if __name__ == '__main__':
    main()


Fixed submission:
def main() -> None:
    n = int(input())
    a_tuple = tuple(map(int, input().split()))

    if 0 in a_tuple:
        print(0)
        return
    boader = 10 ** 18
    answer = 1
    for a in a_tuple:
        answer *= a
        if answer > boader:
            print(-1)
            return
    print(answer)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math


def main() -> None:
    a, b = input().split()

    print((int(a) * (int(b)*100)) // 100)

    return


if __name__ == '__main__':
    main()


Fixed submission:
import math


def main() -> None:
    a, b = input().split()

    print((int(a)*int(b.replace('.', ''))) // 100)

    return


if __name__ == '__main__':
    main()

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


def main() -> None:
    a, b = input().split()

    print((int(a) * (int(b)*100)) // 100)
    retz


if __name__ == '__main__':
    main()


Fixed submission:
import math


def main() -> None:
    a, b = input().split()

    print((int(a)*int(b.replace('.', ''))) // 100)

    return


if __name__ == '__main__':
    main()

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


def main() -> None:
    a, b = input().split()

    print(math.floor(int(a) * int(b*100) / 100))

    return


if __name__ == '__main__':
    main()


Fixed submission:
import math


def main() -> None:
    a, b = input().split()

    print((int(a)*int(b.replace('.', ''))) // 100)

    return


if __name__ == '__main__':
    main()

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


def main() -> None:
    a, b = input().split()

    print(math.floor(a * (b*100) / 100))

    return


if __name__ == '__main__':
    main()


Fixed submission:
import math


def main() -> None:
    a, b = input().split()

    print((int(a)*int(b.replace('.', ''))) // 100)

    return


if __name__ == '__main__':
    main()

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


def main() -> None:
    a, b = map(int, input().split())

    print(math.floor(a * b))
    
    return


if __name__ == '__main__':
    main()


Fixed submission:
import math


def main() -> None:
    a, b = input().split()

    print((int(a)*int(b.replace('.', ''))) // 100)

    return


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, x, y = map(int, input().split())

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

    for i in range(1, n):
        print(distance_list.count(i))


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import collections

    n, x, y = map(int, input().split())

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

    distance_count = collections.Counter(distance_list)
    for i in range(1, n):
        print(distance_count[i])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, x, y = map(int, input().split())

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

    for i in range(1, n):
        print(distance_list.count(i))


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import collections

    n, x, y = map(int, input().split())

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

    distance_count = collections.Counter(distance_list)
    for i in range(1, n):
        print(distance_count[i])


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

    n = int(input())
    balls = list(map(int, input().split()))

    balls_dict = collections.Counter(balls)

    for ball in balls:
        answer = 0
        for num, quantity in balls_dict.items():
            if num == ball:
                answer += (quantity-2) * (quantity-1) // 2
            else:
                answer += quantity * (quantity-1) // 2

        print(answer)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import collections

    n = int(input())
    balls = list(map(int, input().split()))

    balls_dict = collections.Counter(balls)
    num_patterns = 0
    for value in balls_dict.values():
        num_patterns += value * (value-1) // 2

    for ball in balls:
        print(num_patterns - balls_dict[ball] + 1)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    h, w = map(int, input().split())

    if h == 1 or w == 1:
        print(1)
    else:
        print((w * h + 1) // 2))


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    h, w = map(int, input().split())

    if h == 1 or w == 1:
        print(1)
    else:
        print(int(w * (h/2)) if h % 2 == 0 else int(w*(h//2) + (w+1)//2))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from fractions import gcd

    n = int(input())
    num_list = tuple(map(int, input().split()))

    l = 1
    for num in num_list:
        l *= num // gcd(l, num)

    answer = 0

    for num in num_list:
        answer += l // num
        answer %= 10 ** 9 + 7

    print(int(answer))


if __name__ == '__main__':
    main()


Fixed submission:
from fractions import *
n,*a=map(int,open(0).read().split())
b=1
for i in a:b*=i//gcd(b,i)
print(sum(b//i for i in a)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from fractions import gcd

    n = int(input())
    num_list = list(map(int, input().split()))

    l = 1
    for num in num_list:
        l *= num // gcd(l, num)

    answer = 0
    for num in num_list:
        answer += l // num
        answer %= 10 ** 9 + 7

    print(int(answer))


if __name__ == '__main__':
    main()


Fixed submission:
from fractions import *
n,*a=map(int,open(0).read().split())
b=1
for i in a:b*=i//gcd(b,i)
print(sum(b//i for i in a)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from fractions import gcd

    n = int(input())
    num_list = list(map(int, input().split()))

    l = 1
    for num in num_list:
        l *= num // gcd(l, num)

    answer = 0
    for num in num_list:
        answer += l // num
        answer %= 10 ** 9 + 7

    print(int(answer))


if __name__ == '__main__':
    main()


Fixed submission:
from fractions import *
n,*a=map(int,open(0).read().split())
b=1
for i in a:b*=i//gcd(b,i)
print(sum(b//i for i in a)%(10**9+7))

Buggy python submission (verdict: Runtime Error):
def main():
    from fractions import gcd

    n = int(input())
    num_list = list(map(int, input().split()))

    l = 1
    for num in num_list:
        l *= num // gcd(l, num)

    answer = 0
    for num in num_list:
        answer += l // num
        answer %= 1e9 + 7

    print(int(answer))


if __name__ == '__main__':
    main()


Fixed submission:
from fractions import *
n,*a=map(int,open(0).read().split())
b=1
for i in a:b*=i//gcd(b,i)
print(sum(b//i for i in a)%(10**9+7))