Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, WW = map(int, input().split())
W = []
V = []
for _ in range(N):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

inf = float('inf')
dp = [[inf] * (10 ** 5 + 1) for _ in range(N + 1)]
dp[0][0] = 0

for i in range(N):
    for j in range(10 ** 5 + 1):
        dp[i + 1][j] = dp[i][j]
        if j - V[i] >= 0:
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - V[i]] + W[i])

ans = -1

for i in range(10 ** 5 + 1):
    if dp[N][i] <= WW:
        ans = i

print(ans)


Fixed submission:
N, WW = map(int, input().split())
W = []
V = []
for _ in range(N):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

inf = float('inf')
dp = [[inf] * (10 ** 5 + 1) for _ in range(N + 1)]
dp[0][0] = 0

for i in range(N):
    for j in range(10 ** 5 + 1):
        dp[i + 1][j] = dp[i][j]
        if j - V[i] >= 0:
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - V[i]] + W[i])

ans = -1

for i in range(10 ** 5 + 1):
    if dp[N][i] <= WW:
        ans = i

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

dp = [False] * (K + 1)

for i in range(K + 1):
    for j in range(N):
        if i - A[j] >= 0:
            dp[i] |= not dp[i - A[j]]

if dp[K]:
    print('First')
else:
    print('Second')

# print(dp)


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

dp = [False] * (K + 1)

for i in range(K + 1):
    for j in range(N):
        if i - A[j] >= 0:
            dp[i] |= not dp[i - A[j]]

if dp[K]:
    print('First')
else:
    print('Second')

# print(dp)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(M)]

l = [[] for _ in range(N + 1)]

for py in PY:
    l[py[0]].append(py[1])

for py in PY:
    l[py[0]].sort()

for py in PY:
    print('{:0>6}'.format(py[0]) + '{:0>6}'.format(l[py[0]].index(py[1]) + 1))


Fixed submission:
N, M = map(int, input().split())
PY = []
for i in range(M):
    p, y = map(int, input().split())
    PY.append([p, y, i])

PY.sort()

n = 1
now = PY[0][0]
for py in PY:
    if now != py[0]:
        now = py[0]
        n = 1
    py[1] = n
    n += 1

PY.sort(key=lambda val: val[2])

for py in PY:
    print('{:0>6}'.format(py[0]) + '{:0>6}'.format(py[1]))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(M)]

l = [[] for _ in range(N + 1)]

for py in PY:
    l[py[0]].append(py[1])

for py in PY:
    l[py[0]].sort()

for py in PY:
    print('{:0>6}'.format(py[0]) + '{:0>6}'.format(l[py[0]].index(py[1]) + 1))


Fixed submission:
N, M = map(int, input().split())
PY = []
for i in range(M):
    p, y = map(int, input().split())
    PY.append([p, y, i])

PY.sort()

n = 1
now = PY[0][0]
for py in PY:
    if now != py[0]:
        now = py[0]
        n = 1
    py[1] = n
    n += 1

PY.sort(key=lambda val: val[2])

for py in PY:
    print('{:0>6}'.format(py[0]) + '{:0>6}'.format(py[1]))
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

N, M = map(int, input().split())
S = input()
T = input()

ans = (a * b) // gcd(a, b)

if ans == N or ans == M:
    print(-1)
else:
    print(ans)


Fixed submission:
from fractions import gcd

N, M = map(int, input().split())
S = input()
T = input()

lcm = (N * M) // gcd(N, M)
gcd = gcd(N, M)

for i in range(gcd):
    if S[i * N // gcd] != T[i * M // gcd]:
        print(-1)
        exit()

print(lcm)
Buggy python submission (verdict: Time Limit Exceeded):
""" AtCoder """

S = input()
T = input()

for i in range(len(S)):
    index = i
    tmp = T[i]
    while True:
        index = S.find(S[i], index + 1)
        if index == -1:
            break

        if tmp != T[index]:
            print("No")
            exit()

for i in range(len(T)):
    index = i
    tmp = S[i]
    while True:
        index = T.find(T[i], index + 1)
        if index == -1:
            break
        if tmp != S[index]:
            print("No")
            exit()

print("Yes")


Fixed submission:
""" AtCoder """
import collections

S = input()
T = input()

s = {}
t = {}

for i in range(len(S)):
    if S[i] in s and s[S[i]] != T[i] or T[i] in t and t[T[i]] != S[i]:
        print("No")
        exit()
    s[S[i]] = T[i]
    t[T[i]] = S[i]

print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
""" this is C - Triangular Relationship"""

n, m = [int(i) for i in input().split()]

count = 0

for i in range(1, n+1):
    for j in range(i, n+1):
        for k in range(j, n+1):
            a = i+j
            b = j+k
            c = k+i
            if a%m == 0 and b%m == 0 and c%m == 0:
                if i == j and j == k:
                    count += 1
                elif i != j and j == k:
                    count += 3
                elif i == j and j != k:
                    count += 3
                else:
                    count += 6

print(count)


Fixed submission:
""" AtCoder """

N, K = map(int, input().split())

if K % 2 == 0:
    print((N//K) ** 3 + (((N - (K//2))//K + 1) ** 3))
else:
    print((N//K) ** 3)
Buggy python submission (verdict: Runtime Error):
""" AtCoder """

N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    A[i] -= i + 1

A.sort()

b = A[N//2]
bb = A[N//2 + 1]

ans = 0
ansans = 0

for a in A:
    ans += abs(a - b)
    ansans += abs(a - bb)

print(min(ans, ansans))


Fixed submission:
""" AtCoder """

N = int(input())
A = list(map(int, input().split()))

if N ==1:
    print(0)
    exit()

for i in range(N):
    A[i] -= i + 1

A.sort()

b = A[N//2]
bb = A[N//2 + 1]

ans = 0
ansans = 0

for a in A:
    ans += abs(a - b)
    ansans += abs(a - bb)

print(min(ans, ansans))
Buggy python submission (verdict: Time Limit Exceeded):
""" AtCoder """

A, B, K = map(int, input().split())

l = []
for i in range(A, B + 1):
    l.append(i)

ans = []

if B - A < K:
    ans = l
else:
    for i in range(K):
        ans.append(l[i])
        ans.append(l[-i-1])

ans = set(ans)

ans = sorted(ans)

for i in range(len(ans)):
    print(ans[i])


Fixed submission:
""" AtCoder """

A, B, K = map(int, input().split())

l = []
for i in range(A, A + K + 1):
    l.append(i)
for i in range(B - K, B + 1):
    l.append(i)

ans = []

if B - A < K:
    for i in range(A, B + 1):
        ans.append(i)
else:
    for i in range(A, A + K + 1):
        l.append(i)
    for i in range(B - K, B + 1):
        l.append(i)
    for i in range(K):
        ans.append(l[i])
        ans.append(l[-i-1])

ans = set(ans)

ans = sorted(ans)

for i in range(len(ans)):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
S = input()

abc = list("abcdefghijklmnopqrstuvwxyz")
# ord('a') = 97
n = len(abc)
check = [0] * n
for s in S:
    check[ord(s) - 97] = 1

if sum(check) != n:
    for i in range(n):
        if check[i] == 0:
            S += abc[i]
            break
    print(S)
elif S == ''.join(abc[::-1]):
    print(-1)
else:
    check = [0] * n
    for i in range(n):
        if ord(S[i]) > ord(S[i + 1]):
            p = i
            break
        check[ord(S[i]) - 97] = 1
    ans = S[:p - 1]
    for i in range(n):
        if check[i] == 0:
            ans += abc[i]
            break
    print(ans)


Fixed submission:
S = input()

abc = list("abcdefghijklmnopqrstuvwxyz")
# ord('a') = 97
n = len(abc)
check = [0] * n
for s in S:
    check[ord(s) - 97] = 1

if S == ''.join(abc[::-1]):
    print(-1)
    exit()

if sum(check) != n:
    for i in range(n):
        if check[i] == 0:
            S += abc[i]
            break
    print(S)
else:
    check = [0] * n
    for i in range(0, n):
        check[ord(S[::-1][i]) - 97] = 1
        if S[::-1][i] > S[::-1][i + 1]:
            c = 24 - i
            break
    # print(c)
    # print(check)
    # print(S[c])
    ans = S[:c]
    for i in range(ord(S[c]) - 97, n):
        if check[i] == 1:
            ans += abc[i]
            break
    print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()

a = str(int(N) - int(N[-1]) - 1)
b = '9' * (len(N) - 1)

A = 0
B = 0

for aa in a:
    A += int(aa)
for bb in b:
    B += int(bb)
if int(N[0]) > 1:
    B += int(N[0]) - 1

print(max(A, B))


Fixed submission:
N = input()

if len(N) == 1:
    print(int(N))
    exit()

a = str(int(N) - int(N[-1]) - 1)
b = '9' * (len(N) - 1)

A = 0
B = 0
C = 0

for aa in a:
    A += int(aa)
for bb in b:
    B += int(bb)
if int(N[0]) > 1:
    B += int(N[0]) - 1
for n in N:
    C += int(n)


print(max(A, B, C))
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
ans = 0
S = []
for _ in range(H):
    s = list(input())
    ans += s.count('.')
    S.append(s)

inf = float('inf')
G = [[inf] * H * W for _ in range(H * W)]

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]

for h in range(H):
    for w in range(W):
        for x, y in zip(dx, dy):
            nx = w + x
            ny = h + y
            if 0 <= nx < W and 0 <= ny < H and S[ny][nx] != '#':
                G[W * h + w][W * ny + nx] = 1

from scipy.sparse.csgraph import dijkstra

d = dijkstra(G, indices=0)

print(int(ans - d[-1] - 1))


Fixed submission:
H, W = map(int, input().split())
ans = 0
S = []
for _ in range(H):
    s = list(input())
    ans += s.count('.')
    S.append(s)

inf = float('inf')
G = [[inf] * H * W for _ in range(H * W)]

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]

for h in range(H):
    for w in range(W):
        for x, y in zip(dx, dy):
            nx = w + x
            ny = h + y
            if 0 <= nx < W and 0 <= ny < H and S[ny][nx] != '#':
                G[W * h + w][W * ny + nx] = 1

from scipy.sparse.csgraph import dijkstra

d = dijkstra(G, indices=0)
if d[-1] == inf:
    print(-1)
else:
    print(int(ans - d[-1] - 1))
Buggy python submission (verdict: Time Limit Exceeded):
X, Y = map(int, input().split())

if X == Y:
    print(-1)
    exit()
x = 2
while True:
    if X * x % Y != 0:
        print(X * x)
        exit()
    x += 1


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

if X % Y == 0:
    print(-1)
else:
    print(X)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

c = max(0, sum(B) - sum(A))
ca = 0
cb = 0

for a, b in zip(A, B):
    if a < b:
        ca += (b - a + 1) // 2
        cb += (b - a) % 2
    if a > b:
        cb += a - b

if c < max(ca + cb):
    print('No')
else:
    print('Yes')


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

c = max(0, sum(B) - sum(A))
ca = 0
cb = 0

for a, b in zip(A, B):
    if a < b:
        ca += (b - a + 1) // 2
        cb += (b - a) % 2
    if a > b:
        cb += a - b

if c < max(ca, cb):
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

for n in range(1, 3501):
    for w in range(1, 3501):
        t = 4 * n * w - N * w - N * n
        if t > 0:
            h = N * n * w / t
            if h.is_integer() and h > 0:
                print(int(h), n, w)
                exit()


Fixed submission:
N = int(input())

for n in range(1, 3501):
    for w in range(n, 3501):
        t = 4 * n * w - N * w - N * n
        if t > 0:
            h = N * n * w / t
            if h.is_integer() and h > 0:
                print(int(h), n, w)
                exit()
Buggy python submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
  print(A)
else:
  print(B)

Fixed submission:
x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
  print('A')
else:
  print('B')
Buggy python submission (verdict: Runtime Error):
print("ABC" + int(input()))

Fixed submission:
print("ABC"+input())
Buggy python submission (verdict: Runtime Error):
""" AtCoder """

N = int(input())
ans_list = [2, 4, 8, 16, 32, 64]
ans_list = ans_list[::-1]

if N == 1:
    print(1)

for i in range(7):
    if N > ans_list[i]:
        print(ans_list[i])
        break


Fixed submission:
""" AtCoder """

N = int(input())
ans_list = [2, 4, 8, 16, 32, 64]
ans_list = ans_list[::-1]

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

for i in range(7):
    if N >= ans_list[i]:
        print(ans_list[i])
        break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(input().split())

b = []
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.insert(0, a[i])
if n % 2 == 1:
    b.reverse()

print(' '.join(b))


Fixed submission:
from collections import deque

n = int(input())
a = list(input().split())

b = deque()
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
if n % 2 == 1:
    b.reverse()

print(' '.join(b))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

b = []
for aa in a:
    b.append(aa)
    b.reverse()

ans = ''
for bb in b:
    ans += bb + ' '

print(ans[:-1])


Fixed submission:
from collections import deque

n = int(input())
a = list(input().split())

b = deque()
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
if n % 2 == 1:
    b.reverse()

print(' '.join(b))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

B = []
tmp = -1
for a in A:
    if a != tmp:
        B.append(a)
        tmp = a

def f(A):
    ans = 1
    n = len(A)
    if A[0] < A[1]:
        ff = 1
    else:
        ff = -1
    for i in range(1, n - 1):
        if ff == 0:
            if A[i] < A[i + 1]:
                ff = 1
            else:
                ff = -1
        elif ff == 1:
            if A[i] > A[i + 1]:
                ans += 1
                ff = 0
        else:
            if A[i] < A[i + 1]:
                ans += 1
                ff = 0
    return ans

print(f(B))


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

B = []
tmp = -1
for a in A:
    if a != tmp:
        B.append(a)
        tmp = a

if len(B) == 1:
    print(1)
    exit()

def f(A):
    ans = 1
    n = len(A)
    if A[0] < A[1]:
        ff = 1
    else:
        ff = -1
    for i in range(1, n - 1):
        if ff == 0:
            if A[i] < A[i + 1]:
                ff = 1
            else:
                ff = -1
        elif ff == 1:
            if A[i] > A[i + 1]:
                ans += 1
                ff = 0
        else:
            if A[i] < A[i + 1]:
                ans += 1
                ff = 0
    return ans

print(f(B))
Buggy python submission (verdict: Runtime Error):
""" AtCoder """

A, B = map(int, input().split())

if A == 1:
    A = 14
if B == 1:
    B = 14:

if A > B:
    print("Alice")
elif A == B:
    print("Draw")
else:
    print("Bob")


Fixed submission:
""" AtCoder """

A, B = map(int, input().split())

if A == 1:
    A = 14
if B == 1:
    B = 14

if A > B:
    print("Alice")
elif A == B:
    print("Draw")
else:
    print("Bob")
Buggy python submission (verdict: Runtime Error):
""" AtCoder """

N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

check = True

for i in range(N - M + 1):
    check = True
    for j in range(M):
        count = 0
        for jj in range(N - M + 1):
            if A[i + jj][j:j + M] != B[jj]:
                check = False
                break
            count += 1
        if count == M:
            print("Yes")
            exit()
        if not check:
            break

print("No")


Fixed submission:
""" AtCoder """

N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

for i in range(N - M + 1):
    for j in range(N - M + 1):
        count = 0
        for jj in range(M):
            if A[i + jj][j:j + M] != B[jj]:
                break
            count += 1
        if count == M:
            print("Yes")
            exit()

print("No")
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000)

N, M = map(int, input().split())
edge = [[] for _ in range(N + 1)]
ab = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    a, b = ab[i][0], ab[i][1]
    edge[a].append(b)
    edge[b].append(a)


def f(now, v):
    v = v & (1 << now)
    for to in edge[now]:
        if v >> to == 0:
            f(to, v)
    if v == int('0b11111111', 0):
        ans += 1

ans = 0
f(1, 1)

print(ans)


Fixed submission:
import sys
sys.setrecursionlimit(1000000)

N, M = map(int, input().split())
edge = [[] for _ in range(N + 1)]
ab = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    a, b = ab[i][0] - 1, ab[i][1] - 1
    edge[a].append(b)
    edge[b].append(a)

ans = 0

def f(now, v):
    global ans
    v |= (1 << now)
    for to in edge[now]:
        if not (v & (1<<to)):
            f(to, v)
    if bin(v).count("1") == N:
        ans += 1

f(0, 0)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, Ma, Mb = map(int, input().split())
abc = [list(map(int, input().split())) for _ in range(N)]

inf = float('inf')
dp = [[[inf] * 401 for _ in range(401)] for _ in range(N + 1)]

dp[0][0][0] = 0

for i in range(N):
    for j in range(401):
        for k in range(401):
            if j - abc[i][0] >= 0 and k - abc[i][1] >= 0:
                dp[i + 1][j][k] = min(dp[i][j][k], dp[i][j - abc[i][0]][k - abc[i][1]] + abc[i][2])
            else:
                dp[i + 1][j][k] = dp[i][j][k]
ans = inf
for a in range(1, 401):
    if a % Ma == 0:
        b = a // Ma * Mb
        if b <= 401:
            ans = min(ans, dp[N][a][b])
if ans == inf:
    ans = -1
print(ans)


Fixed submission:
N, Ma, Mb = map(int, input().split())
abc = [list(map(int, input().split())) for _ in range(N)]

inf = float('inf')
dp = [[[inf] * 401 for _ in range(401)] for _ in range(N + 1)]

dp[0][0][0] = 0

for i in range(N):
    for j in range(401):
        for k in range(401):
            dp[i + 1][j][k] = dp[i][j][k]
            if j - abc[i][0] >= 0 and k - abc[i][1] >= 0:
                dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j - abc[i][0]][k - abc[i][1]] + abc[i][2])
ans = inf
for a in range(1, 401):
    for b in range(1, 401):
        if a * Mb == b * Ma:
            ans = min(ans, dp[N][a][b])
if ans == inf:
    ans = -1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
"""AtCoder"""

K, N = map(int, input().split())

ans = 0

for i in range(K+1):
  for j in range(K+1):
    for k in range(K+1):
      if i + j + k  == N:
        ans += 1

print(ans)


Fixed submission:
"""AtCoder"""

K, N = map(int, input().split())

ans = 0

for i in range(K+1):
  for j in range(K+1):
    if i + j <= N and i + j + K >= N:
      ans += 1



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

mod = 10 ** 9 + 7
ans = 0

if N % 2 == 0:
    for i in range(1, N, 2):
        if A.count(i) != 2:
            print(0)
            exit()
    print(2 ** (N // 2) % mod)
else:
    for i in range(2, N, 2):
        if A.count(i) != 2:
            print(0)
            exit()
    if A.count(0) != 1:
        print(0)
        exit()
    print(2 ** (N // 2) % mod)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
mod = 10 ** 9 + 7
ans = 0
B = []
if N % 2 == 0:
    for i in range(1, N, 2):
        B.append(i)
        B.append(i)
else:
    B.append(0)
    for i in range(2, N, 2):
        B.append(i)
        B.append(i)

if A == B:
    print(2 ** ( N // 2) % mod)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
""" AtCoder """

A, s, C = map(int, input().split())

print('A' + s[0] + 'C')


Fixed submission:
""" AtCoder """

A, s, C = input().split()

print('A' + s[0] + 'C')
Buggy python submission (verdict: Runtime Error):
""" AtCoder """

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

print((a + b) * h / 2)


Fixed submission:
""" AtCoder """

a = int(input())
b = int(input())
h = int(input())

print(int((a + b) * h / 2))
Buggy python submission (verdict: Time Limit Exceeded):
N, A = map(int, input().split())
X = list(map(int, input().split()))

dp = [[[0 for _ in range(3000)] for _ in range(N + 1)] for _ in range(N + 1)]
dp[0][0][0] = 1

for i in range(N):
    for j in range(N):
        for t in range(2501):
            dp[i + 1][j][t] += dp[i][j][t]
            dp[i + 1][j + 1][t + X[i]] += dp[i][j][t]

ans = 0

for i in range(1, N + 1):
    ans += dp[N][i][i * A]

print(ans)


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

dp = [[[0 for _ in range(3000)] for _ in range(N + 1)] for _ in range(N + 1)]
dp[0][0][0] = 1

for i in range(N):
    for j in range(N):
        for t in range(2501):
            dp[i + 1][j][t] += dp[i][j][t]
            dp[i + 1][j + 1][t + X[i]] += dp[i][j][t]

ans = 0

for i in range(1, N + 1):
    ans += dp[N][i][i * A]

print(ans)
Buggy python submission (verdict: Runtime Error):
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

if S == "?":
  print("D")
if S == "P?":
  print("PD")
if S == "D?":
  print("DD")
if S == "?D":
  print("PD")
if S == "?P":
  print("DP")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i-1] == "D":
      S[i] = "P"

    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Fixed submission:
S = list(input())
lon = len(S)
for i in range(lon):
  if S[i] == "?":
    S[i] = "D"
 
    

T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Buggy python submission (verdict: Runtime Error):
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

if S == "?":
  print("D")
is S == "P?":
  print("PD")
if S == "D?":
  print("DD")
if S == "?D":
  print("PD")
if S == "?P":
  print("DP")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i-1] == "D":
      S[i] = "P"

    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Fixed submission:
S = list(input())
lon = len(S)
for i in range(lon):
  if S[i] == "?":
    S[i] = "D"
 
    

T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Buggy python submission (verdict: Runtime Error):
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i+1] == "D":
      S[i] = "P"
    elif S[i-1] == "D":
      S[i] = "P"
    else:
      S[i] = "D"

    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Fixed submission:
S = list(input())
lon = len(S)
for i in range(lon):
  if S[i] == "?":
    S[i] = "D"
 
    

T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Buggy python submission (verdict: Runtime Error):
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i+1] == "D":
      S[i] = "P"
    elif S[i-1] == "D":
      S[i] = "P"
    else:
      S[i] = "D"


if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

Fixed submission:
S = list(input())
lon = len(S)
for i in range(lon):
  if S[i] == "?":
    S[i] = "D"
 
    

T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)
Buggy python submission (verdict: Runtime Error):
K = int(input())
A, B = map(int,input().split())
n_A = A//K
n_B = B//K
if n_B - b_A >= 1:
  print("Yes"):
else:
  print("No")

Fixed submission:
K = int(input())
A, B = map(int,input().split())
m = B // K
if m*K >= A:
  print("OK")
else:
  print("NG")