Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())
if (R - L + 1) >= 2019:
    print(0)
else:
    ans = 5000
    for i in range(L, R):
        for j in range(L + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)

Fixed submission:
L, R = map(int, input().split())
mod = 2019
ans = mod
for l in range(L, L + mod + 2):
    for r in reversed(range(R - mod - 2, R + 1)):
        if l >= r:
            break
        ans = min(ans, (l * r) % mod)
print(ans)

Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())
if (R - L + 1) >= 2019:
    print(0)
else:
    ans = 10 ** 9 + 7
    for i in range(L, R):
        for j in range(L + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)

Fixed submission:
L, R = map(int, input().split())
mod = 2019
ans = mod
for l in range(L, L + mod + 2):
    for r in reversed(range(R - mod - 2, R + 1)):
        if l >= r:
            break
        ans = min(ans, (l * r) % mod)
print(ans)

Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())
if (R - L + 1) >= 2019:
    print(0)
else:
    ans = 10 ** 9 + 7
    for i in range(L, R + 1):
        for j in range(L + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)

Fixed submission:
L, R = map(int, input().split())
mod = 2019
ans = mod
for l in range(L, L + mod + 2):
    for r in reversed(range(R - mod - 2, R + 1)):
        if l >= r:
            break
        ans = min(ans, (l * r) % mod)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
ans = 10 ** 9 + 7
if (L - R + 1) >= 2019:
    print(0)
else:
    for i in range(L, R + 1):
        for j in range(i + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)

Fixed submission:
L, R = map(int, input().split())
mod = 2019
ans = mod
for l in range(L, L + mod + 2):
    for r in reversed(range(R - mod - 2, R + 1)):
        if l >= r:
            break
        ans = min(ans, (l * r) % mod)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
ans = 10 ** 9 + 7
if (L - R + 1) >= 2019:
    print(0)
else:
    for i in range(L, R + 1):
        for j in range(i + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)

Fixed submission:
L, R = map(int, input().split())
mod = 2019
ans = mod
for l in range(L, L + mod + 2):
    for r in reversed(range(R - mod - 2, R + 1)):
        if l >= r:
            break
        ans = min(ans, (l * r) % mod)
print(ans)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

int main(){

    string s;
    cin >> s;

    if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]){
        cout << "Bad" << endl;
    }
    else{
        cout << "Good" << endl;
    }

    return 0;
}

Fixed submission:
s = input()
if (s[0] == s[1] or s[1] == s[2] or s[2] == s[3]):
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
b = int(input())
ans = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
print(ans[b])

Fixed submission:
b = input()
ans = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
print(ans[b])
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
cnt = 0
for i in range(q):
    l, r = map(int, input().split())
    for j in range(l - 1, r - 1):
        if s[j] == "A" and s[j + 1] == "C":
            cnt += 1
    print(cnt)
    cnt = 0


Fixed submission:
n, q = map(int, input().split())
s = input()
t = [0] * (n + 1)
for i in range(n):
    if s[i : i + 2] == "AC":
        t[i + 1] = t[i] + 1
    else:
        t[i + 1] = t[i]
for i in range(q):
    l, r = map(int, input().split())
    print(t[r - 1] - t[l - 1])
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ans_list = []
for i in reversed(range(1, min(a, b))):
    if (a % i == 0) and (b % i == 0):
            ans_list.append(i)
print(ans_list[k-1])



Fixed submission:
a, b, k = map(int, input().split())
ans_list = []
for i in reversed(range(1, min(a, b)+1)):
    if (a % i == 0) and (b % i == 0):
            ans_list.append(i)
print(ans_list[k-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = input().split()
L = [int(s) for s in L]
i = 0
L_max = 0
for i in range(len(L)):
    if L[i] < L[i+1]:
        L_max = L[i+1]
if L_max > sum(L):
    print("Yes")
else:
    print("No")        

Fixed submission:
N = int(input())
L = input().split()
L = [int(s) for s in L]
i = 0
L_max = L[0]
for i in range(len(L)):
    if L_max < L[i]:
        L_max = L[i]
if L_max < sum(L) - L_max:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
if an.index(1 or 2) == 0:
    print(4)
else:
    print(an.index(4) + 4)


Fixed submission:
x, y, z = map(int, input().split())
print(int(x * y / 2))

Buggy python submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(1 or 2 or 4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)



Fixed submission:
x, y, z = map(int, input().split())
print(int(x * y / 2))

Buggy python submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(1 or 2 or 4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)


Fixed submission:
x, y, z = map(int, input().split())
print(int(x * y / 2))

Buggy python submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)



Fixed submission:
x, y, z = map(int, input().split())
print(int(x * y / 2))

Buggy python submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)

Fixed submission:
x, y, z = map(int, input().split())
print(int(x * y / 2))

Buggy python submission (verdict: Runtime Error):
x, y, z = map(int, input()split())
print(x * y / 2)


Fixed submission:
x, y, z = map(int, input().split())
print(int(x * y / 2))

Buggy python submission (verdict: Runtime Error):
x, y, z = int(input()split())
print(x * y / 2)


Fixed submission:
x, y, z = map(int, input().split())
print(int(x * y / 2))
Buggy python submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
if an.index(1 or 2) == 0:
    print(4)
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)


Fixed submission:
s = int(input())
an = []
an.append(s)
n = s
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
if an.index(1) == 0:
            print(4)
elif an.index(2) == 0:
            print(4)
else:
    print(an.index(4) + 4)
Buggy python submission (verdict: Runtime Error):
n = input().split()
ans = n.replace("1", "a")
ans = n.replace("9", "1")
ans = n.replace("a", "9")
print(int(ans))

Fixed submission:
n = int(input())
print(1110-n)
Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in range(N//4):
    for j in range(N//7):
        if(4*i + 7+j == N):
            print("Yes")
            exit()
print("No")
            

Fixed submission:
N, K = map(int, input().split())
print(-(-N//K) - N//K)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
for _ in range(len(s)):
    if s == t:
        print('Yes')
        break
    s = s[-1] + s[:-1]
else:
    print('No')

Fixed submission:
A = sorted(map(int, input().split()))
print(A[2] - A[0])
Buggy python submission (verdict: Runtime Error):
N = input()
array = list(map(int, N))
S_n = sum(array)
if(int(N) % S_n == 0):
    print("Yes")
else:
    print("No")


Fixed submission:
S = list(input())
print(S.count("+") - S.count("-"))
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
snowless = []
cnt = 0
ans = 0
for i in range(1, 1000):
    cnt += i
    snowless.append(cnt)

for j in range(snowless[-1]):
    if a + j in snowless and b + j in snowless:
        ans = j

print(ans)


Fixed submission:
a, b = map(int, input().split())
snowless = []
cnt = 0
ans = 0
for i in range(1, 1000):
    cnt += i
    snowless.append(cnt)

for j in range(snowless[-1]):
    if a + j in snowless and b + j in snowless:
        ans = j

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if abs(a-c) <= d || abs(a-b) <= d and abs(b-c) <= d:
    print("Yes")
else:
    print("No")


Fixed submission:
a, b, c, d = map(int, input().split())
if abs(a-c) <= d:
    print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
S[3] = "8"
print(S)

Fixed submission:
S = input()
print(S[:3] + "8" + S[4:])

Buggy python submission (verdict: Runtime Error):
S = input()
S[3] = 8
print(S)

Fixed submission:
S = input()
print(S[:3] + "8" + S[4:])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
cnt = 0
while True:
    i = 0
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] /=2
            i += 1
        else:
            i += 1
            break
print(cnt)


Fixed submission:
N = input()
A = list(map(int, input().split()))
cnt = 0
while all(i % 2 == 0 for i in A):
    A = [int(j / 2) for j in A]
    cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
num = []
for i in range(n-1):
    for j in range(i+1, n):
        if a[i] == a[j]:
            num.append(a[i])
print(n - 2 * len(num))
            

Fixed submission:
n = int(input())
num = set()
ans = 0

for i in range(n):
    a = int(input())
    if a in num:
        num.remove(a)
        ans -= 1
    else:
        num.add(a)
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
num = []
for i in range(n-1):
    for j in range(i+1, n):
        if a[i] == a[j]:
            num.append(a[i])
print(n - 2 * len(num))
            

Fixed submission:
n = int(input())
num = set()
ans = 0

for i in range(n):
    a = int(input())
    if a in num:
        num.remove(a)
        ans -= 1
    else:
        num.add(a)
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
if abs(x - a) >= abs(x - b):
    print("B"):
else:
    print("A")

Fixed submission:
x, a, b = map(int, input().split())
if abs(x - a) >= abs(x - b):
    print("B")
else:
    print("A")
Buggy python submission (verdict: Runtime Error):
S = list(input())
a_to_z = "abcdefghijklmnopqrstuvwxyz"
s.sort()
ans = "None"
for string in a_to_z:
    if string not in S:
        ans = string
        break
print(ans)
        
        

Fixed submission:
S = list(input())
a_to_z = "abcdefghijklmnopqrstuvwxyz"
S.sort()
ans = "None"
for string in a_to_z:
    if string not in S:
        ans = string
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
N = list(input())
if N.sorted(reverse = True) == N:
    print("Yes")
else:
    print("No")


Fixed submission:
N = list(input())
if N[::-1] == N:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
ans = ""
for i in range(len(o)):
    ans += o[i] + e[i]
print(ans)

Fixed submission:
o = input()
e = input()
ans = ""
for i in range(len(e)):
    ans += o[i] + e[i]
if len(o) > len(e):
    ans += o[-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if 0 <= a:
    print("Positive")
elif b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
else:
    print(Zero)


Fixed submission:
a, b = map(int, input().split())
if 0 <= a:
    print("Positive")
elif b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
else:
    print("Zero")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict, deque

n, q = map(int, input().split())

tree = defaultdict(lambda: [])
for _ in range(n - 1):
    a, b = map(int, input().split())
    tree[a].append(b)
    tree[b].append(a)

count = defaultdict(lambda: 0)
for _ in range(q):
    p, x = map(int, input().split())
    count[p] += x

ret = [0] * n
q = deque(maxlen=n)
q.append((1, 1))
while len(q) > 0:
    f, c = q.popleft()
    ret[c - 1] = count[c] + ret[f - 1]
    for n in tree[c]:
        if n != f:
            q.append((c, n))

print(*ret)


Fixed submission:
from collections import deque

d = ' '
n, q = map(int, input().split(d))

tree = [[] for _ in range(n)]

for _ in range(n - 1):
    a, b = map(int, input().split(d))
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

count = [0 for _ in range(n)]
for _ in range(q):
    p, x = map(int, input().split(d))
    p -= 1
    count[p] += x

ret = [0 for _ in range(n)]
q = deque(maxlen=n)
q.append((0, 0))
while len(q) > 0:
    f, c = q.popleft()
    ret[c] = count[c] + ret[f]
    for n in tree[c]:
        if n != f:
            q.append((c, n))

print(*ret)
Buggy python submission (verdict: Runtime Error):
n = int(input())
hs = list(map(int, input().split()))

answer = 0
for i, hi in enumerate(hs)[1:]:
  if max(hs[:i]) <= hs[i]:
    answer += 1

print(answer)

Fixed submission:
n = int(input())
hs = list(map(int, input().split()))
 
answer = 1
for i in range(1, n):
  if max(hs[:i]) <= hs[i]:
    answer += 1
 
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

if __name__ == '__main__':
    N, K = map(int, input().split())
    xy_list = [list(map(int, input().split())) for i in range(N)]

    all_x = sorted(list(set([xy[0] for xy in xy_list])))
    all_y = sorted(list(set([xy[1] for xy in xy_list])))

    answer = sys.maxsize
    for i in range(len(all_x)):
        x1 = all_x[i]
        for j in range(i+1, len(all_x)):
            x2 = all_x[j]
            for k in range(len(all_y)):
                y1 = all_y[k]
                for l in range(k+1, len(all_y)):
                    y2 = all_y[l]
                    if answer > (x2-x1) * (y2-y1) and K <= sum(map(lambda xy: (x1 <= xy[0] <= x2) and (y1 <= xy[1] <= y2), xy_list)):
                        answer = (x2-x1) * (y2-y1)

    print(answer)


Fixed submission:
import sys

if __name__ == '__main__':
    N, K = map(int, input().split())
    xy_list = [list(map(int, input().split())) for i in range(N)]

    all_x = sorted(list(set([xy[0] for xy in xy_list])))
    all_y = sorted(list(set([xy[1] for xy in xy_list])))

    answer = sys.maxsize
    for i in range(len(all_x)):
        x1 = all_x[i]
        for j in range(i+1, len(all_x)):
            x2 = all_x[j]
            for k in range(len(all_y)):
                y1 = all_y[k]
                for l in range(k+1, len(all_y)):
                    y2 = all_y[l]
                    if answer > (x2-x1) * (y2-y1) and K <= sum(map(lambda xy: (x1 <= xy[0] <= x2) and (y1 <= xy[1] <= y2), xy_list)):
                        answer = (x2-x1) * (y2-y1)

    print(answer)

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

if __name__ == '__main__':
    N, K = map(int, input().split())
    xy_list = [list(map(int, input().split())) for i in range(N)]

    all_x = sorted(list(set([xy[0] for xy in xy_list])))
    all_y = sorted(list(set([xy[1] for xy in xy_list])))

    answer = sys.maxsize
    for i in range(len(all_x)):
        x1 = all_x[i]
        for j in range(i+1, len(all_x)):
            x2 = all_x[j]
            for k in range(len(all_y)):
                y1 = all_y[k]
                for l in range(k+1, len(all_y)):
                    y2 = all_y[l]
                    if answer > (x2-x1) * (y2-y1) and K <= len([xy for xy in xy_list if (x1 <= xy[0] <= x2) and (y1 <= xy[1] <= y2)]):
                        answer = (x2-x1) * (y2-y1)

    print(answer)


Fixed submission:
import sys

if __name__ == '__main__':
    N, K = map(int, input().split())
    xy_list = [list(map(int, input().split())) for i in range(N)]

    all_x = sorted(list(set([xy[0] for xy in xy_list])))
    all_y = sorted(list(set([xy[1] for xy in xy_list])))

    answer = sys.maxsize
    for i in range(len(all_x)):
        x1 = all_x[i]
        for j in range(i+1, len(all_x)):
            x2 = all_x[j]
            for k in range(len(all_y)):
                y1 = all_y[k]
                for l in range(k+1, len(all_y)):
                    y2 = all_y[l]
                    if answer > (x2-x1) * (y2-y1) and K <= sum(map(lambda xy: (x1 <= xy[0] <= x2) and (y1 <= xy[1] <= y2), xy_list)):
                        answer = (x2-x1) * (y2-y1)

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

n = int(input())
k = int(input())
xs = [int(input()) for i in range(n)]

print(2*sum([min([x, k - x]) for x in xs]))

Fixed submission:
import math

n = int(input())
k = int(input())
xs = list(map(int, input().strip().split()))

print(2*sum([min([x, k - x]) for x in xs]))

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

n = int(input())
k = int(input())
xs = [int(input()) for i in range(n)]

print(2*sum(min([x, k - x])))

Fixed submission:
import math

n = int(input())
k = int(input())
xs = list(map(int, input().strip().split()))

print(2*sum([min([x, k - x]) for x in xs]))
Buggy python submission (verdict: Runtime Error):
n, m, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
time = 0
i = 0
j = 0
while i <= n and j <= m and time <= k:
    if i == n:
        if j == m:
            break
        time += b[j]
        j += 1
        continue
    if j == n:
        time += a[i]
        i += 1
        continue
    if a[i] < b[j]:
        time += a[i]
        i += 1
        continue
    else:
        time += b[j]
        j += 1
        continue
if time > k:
    print(i+j-1)
else:
    print(i+j)


Fixed submission:
n, m, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
s = 0
maxbooks = 0
for i in range(n):
    if s + a[i] <= k:
        s += a[i]
        continue
    else:
        i -= 1
        break
for j in range(m):
    if s + b[j] <= k:
        s += b[j]
        continue
    else:
        j -= 1
        break
maxbooks = i + j + 2
nowbooks = i + j + 2
#i, j: 読めたもの
while i >= 0 and j < m:
    s -= a[i]
    i -= 1
    nowbooks -= 1
    while j + 1 < m:
        if s + b[j+1] <= k:
            s += b[j+1]
            j += 1
            nowbooks += 1
            if nowbooks > maxbooks:
                maxbooks = nowbooks
            
            continue
        else:
            break
last = 0
s = 0
for j in range(m):
    if s + b[j] <= k:
        s += b[j]
        continue
    else:
        j -= 1
        break
if j > maxbooks:
    maxbooks = j
print(maxbooks)
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
a=0
b=0
set5 = set([i**5 for i in range(100)])
set5 = set5 | set([-i**5 for i in range(100)])
while True:
    a += 1
    #calc = a**5 - b**5
    #if calc == x:
    #    print(str(a)+" "+str(b))
    #    break
    #else:
    #    if
    if (a**5-x) in set5:
        if a**5-x < 0:
            b = -int((x-a**5)**(1/5)+0.01)
        else:
            b = int((a**5-x)**(1/5)+0.01)
        print(str(a)+" "+str(b))
        break

Fixed submission:
x=int(input())
a=0
b=0
set5 = set([i**5 for i in range(1000)])
set5 = set5 | set([-i**5 for i in range(1000)])
while True:
    a += 1
    #calc = a**5 - b**5
    #if calc == x:
    #    print(str(a)+" "+str(b))
    #    break
    #else:
    #    if
    temp = (a**5-x)
    if temp in set5:
        if a**5-x < 0:
            b = -int((-temp)**(1/5)+0.01)
        else:
            b = int(temp**(1/5)+0.01)
        print(str(a)+" "+str(b))
        break
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
s = 0
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s += math.gcd(a,math.gcd(b,c))
print(s)

Fixed submission:
import math
k = int(input())
s = 0
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s += math.gcd(a,math.gcd(b,c))
print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for _ in range(n):
  x = input()
  if x == 'AC':
    ac += 1
  elif x == 'WA':
    wa += 1
  elif x == 'TLE':
    tle += 1
  else:
    re += 1
    
print('AC x ', ac)
print('WA x ', waz)
print('TLE x ', tle)
print('RE x ', re)

Fixed submission:
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for _ in range(n):
  x = input()
  if x == 'AC':
    ac += 1
  elif x == 'WA':
    wa += 1
  elif x == 'TLE':
    tle += 1
  else:
    re += 1
    
print('AC x ', ac)
print('WA x ', wa)
print('TLE x ', tle)
print('RE x ', re)
Buggy python submission (verdict: Runtime Error):
t[i] == '?' and t[i+1] == 'D':

Fixed submission:
t= list(input())
if t[-1] == '?':
  t[-1] = 'D'

if t[0] == '?':
  if t[1] == 'D':
    t[0] = 'P'
  elif t[1] == 'P':
    t[0] = 'D'
  else:
    t[0] = 'P'
    t[1] = 'D'

for i in range(1, len(t)-1):
  if t[i] == '?':
    if t[i-1] == 'P':
      t[i] = 'D'
    elif t[i-1] == 'D':
      if t[i+1] == 'P':
        t[i] = 'D'
      elif t[i+1] == 'D':
        t[i] = 'P'
      else:
        t[i] = 'P'
        t[i+1] = 'D'
    
    
print(''.join(t))
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

if s = t[:-1]:
  print('Yes')
else:
  print('No')

Fixed submission:
s = input()
t = input()

if s+t[-1] == t:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
a, b, n= [int(i) for i in input().split()]

ans = 0

for i in range(min(n, b-1), 0, -1):
  ans = max(ans, int((a*i)/b))
  if int((a*i)/b) < ans:
    break
  
print(ans)

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

if int(n/b) == 0:
  print(int((a*n)/b))
else:
  print(int((a*(b-1))/b))

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

max = 0

for i in range(n+1):
  x = int((a*i)/b)-a*int(i/b)
  if x > max:
    max = x
  elif max > x:
    break
    
print(max)

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

if int(n/b) == 0:
  print(int((a*n)/b))
else:
  print(int((a*(b-1))/b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]
l = []
a = 0
for i in s:
  if i not in l:
    l.append(i)
    a += 1
    
print(a)


Fixed submission:
n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())
s = [input() for i in range(n)]
l = deque([])
for i in s:
  if i not in l:
    l.appendleft(i)
    
print(len(l))


Fixed submission:
n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
  s = input()
  if s not in l:
    l.append(s)
    
print(len(l))

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))
Buggy python submission (verdict: Runtime Error):
r = int(input())
prinrt(2*r*3.141592)

Fixed submission:
import math
r = int(input())
pi = math.pi
print(r*2*pi)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(input().split())
l = [str(i) for i in range(1, n+1)]

for i in range(n):
  print(a.count(l[i]))

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
ans = [0]*n

for i in a:
  ans[i-1] += 1
for j in ans:
  print(j)