Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import collections

def solve(n, s):
    records = []
    D = {}
    for i in range(n):
        counter = collections.Counter(s[i])
        k = ",".join([f"{k}:{v}" for k, v in sorted(counter.items())])
        if not k in D:
            D[k] = 0
        D[k] += 1
    res = 0
    for k, v in D.items():
        res += v * (v-1) // 2
    return res

n = int(input())
s = [input() for i in range(n)]
print(solve(n, s))

Fixed submission:
import collections

def solve(n, s):
    records = []
    D = {}
    for i in range(n):
        counter = collections.Counter(s[i])
        k = ",".join(["%s:%d" % (k,v) for k, v in sorted(counter.items())])
        if not k in D:
            D[k] = 0
        D[k] += 1
    res = 0
    for k, v in D.items():
        res += v * (v-1) // 2
    return res

n = int(input())
s = [input() for i in range(n)]
print(solve(n, s))
Buggy python submission (verdict: Time Limit Exceeded):
def f(n, D, p, q):
    for i in range(n-2):
        r = p ^ q
        if (r in D) and (D[r] > 0):
            D[r] -= 1
        else:
            return -1
        p, q = q, r
    return p ^ q

def solve(n, a):
    D = {}
    for x in a:
        if not x in D:
            D[x] = 0
        D[x] += 1
    D[a[0]] -= 1
    for i in range(1, n):
        D[a[i]] -= 1
        ok = f(n, D.copy(), a[0], a[i]) == a[0]
        D[a[i]] += 1
        if ok:
            return "Yes"
    return "No"

n = int(input())
a = list(map(int, input().split()))
print(solve(n, a))

Fixed submission:
def solve(n, a):
    p = 0
    for x in a:
        p ^= x
    return "Yes" if p == 0 else "No"

n = int(input())
a = list(map(int, input().split()))
print(solve(n, a))
Buggy python submission (verdict: Runtime Error):
def solve(n, x, l):
    ans = 1
    d = 0
    for i in range(n)
        d += l[i]
        if d <= x:
            ans += 1
    return ans
    
n, x = map(int, input().split())
l = list(map(int, input().split()))
print(solve(n, x, l))


Fixed submission:
def solve(n, x, l):
    ans = 1
    d = 0
    for i in range(n):
        d += l[i]
        if d <= x:
            ans += 1
    return ans

n, x = map(int, input().split())
l = list(map(int, input().split()))
print(solve(n, x, l))
Buggy python submission (verdict: Time Limit Exceeded):
MOD = 1000000007
def solve(n, m, a):
    dp = [0] * (n+1)
    dp[n] = 1
    for i in range(n-1, -1, -1):
        for d in range(1, 3):
            j = i + d
            if (j <= n) and (not j in a):
                dp[i] = (dp[i] + dp[j]) % MOD
    return dp[0]

n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
print(solve(n, m, a))

Fixed submission:
MOD = 1000000007
def solve(n, m, a):
    a = set(a)
    dp = [0] * (n+1)
    dp[n] = 1
    for i in range(n-1, -1, -1):
        for d in range(1, 3):
            j = i + d
            if (j <= n) and (not j in a):
                dp[i] = (dp[i] + dp[j]) % MOD
    return dp[0]

n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
print(solve(n, m, a))
Buggy python submission (verdict: Time Limit Exceeded):
def solve(s):
    D = {"A":0,"B":1,"C":2}
    s = list(map(D.__getitem__, s))
    n = len(s)
    res = 0
    i = 0
    before = list(map(D.__getitem__, "ABC"))
    after = list(map(D.__getitem__, "BCA"))
    m = len(before)
    while i+m <= n:
        if s[i:i+m] == before:
            s[i:i+m] = after
            i = max(0, i-1)
            res += 1
        else:
            i += 1
    return res

s = input()
print(solve(s))

Fixed submission:
def solve(s):
    n = len(s)
    res = 0
    i = 0
    num = 0
    while i < n-1:
        if s[i] == "A":
            num += 1
            i += 1
        elif s[i:i+2] == "BC":
            res += num
            i += 2
        else:
            num = 0
            i += 1
    return res

s = input()
print(solve(s))

Buggy python submission (verdict: Time Limit Exceeded):
def solve(s):
    s = list(s)
    n = len(s)
    res = 0
    i = 0
    before = list("ABC")
    after = list("BCA")
    m = len(before)
    while i+m <= n:
        if s[i:i+m] == before:
            s[i:i+m] = after
            i = max(0, i-1)
            res += 1
        else:
            i += 1
    return res

s = input()
print(solve(s))

Fixed submission:
def solve(s):
    n = len(s)
    res = 0
    i = 0
    num = 0
    while i < n-1:
        if s[i] == "A":
            num += 1
            i += 1
        elif s[i:i+2] == "BC":
            res += num
            i += 2
        else:
            num = 0
            i += 1
    return res

s = input()
print(solve(s))

Buggy python submission (verdict: Time Limit Exceeded):
def solve(s):
    s = list(s)
    n = len(s)
    res = 0
    i = 0
    while i+3 <= n:
        ok = True
        for j, c in enumerate("ABC"):
            if s[i+j] != c:
                ok = False
                break
        if ok:
            s[i], s[i+1], s[i+2] = "B", "C", "A"
            i = max(0, i-1)
            res += 1
        else:
            i += 1
    return res

s = input()
print(solve(s))

Fixed submission:
def solve(s):
    n = len(s)
    res = 0
    i = 0
    num = 0
    while i < n-1:
        if s[i] == "A":
            num += 1
            i += 1
        elif s[i:i+2] == "BC":
            res += num
            i += 2
        else:
            num = 0
            i += 1
    return res

s = input()
print(solve(s))
Buggy python submission (verdict: Runtime Error):
def solve(n, s, k):
    return "".join([("*" if s[i] != s[k] else s[i]) for i in range(n)])

n = int(input())
s = input()
k = int(input())
print(solve(n, s, k))

Fixed submission:
def solve(n, s, k):
    return "".join([("*" if s[i] != s[k-1] else s[i]) for i in range(n)])

n = int(input())
s = input()
k = int(input())
print(solve(n, s, k))
Buggy python submission (verdict: Runtime Error):
import numpy as np

def count(s):
    prev = ""
    cnt = 0
    dp = np.zeros(len(s)+1, dtype=int)
    for i, c in enumerate(s):
        if (prev == "A") and (c == "C"):
            cnt += 1
        prev = c
        dp[i+1] = cnt
    return dp

def solve(n, q, s, l, r):
    dp = count(s)
    for i in range(q):
        print(dp[r[i]] - dp[l[i]])

n, q = map(int, input().split())
s = input()
l = np.zeros(n, dtype=int)
r = np.zeros(n, dtype=int)
for i in range(q):
    l[i], r[i] = map(int, input().split())
solve(n, q, s, l, r)

Fixed submission:
import numpy as np

def count(s):
    prev = ""
    cnt = 0
    dp = np.zeros(len(s)+1, dtype=int)
    for i, c in enumerate(s):
        if (prev == "A") and (c == "C"):
            cnt += 1
        prev = c
        dp[i+1] = cnt
    return dp

def solve(n, q, s, l, r):
    dp = count(s)
    for i in range(q):
        print(dp[r[i]] - dp[l[i]])

n, q = map(int, input().split())
s = input()
l = np.zeros(q, dtype=int)
r = np.zeros(q, dtype=int)
for i in range(q):
    l[i], r[i] = map(int, input().split())
solve(n, q, s, l, r)

Buggy python submission (verdict: Runtime Error):
import numpy as np

def count(s):
    prev = ""
    cnt = 0
    dp = np.zeros(len(s)+1, dtype=int)
    for i, c in enumerate(s):
        if (prev == "A") and (c == "C"):
            cnt += 1
        prev = c
        dp[i+1] = cnt
    return dp

def solve(n, q, s, l, r):
    dp = count(s)
    for i in range(q):
        print(dp[r[i]] - dp[l[i]])

n, q = map(int, input().split())
s = input()
l = np.zeros(n, dtype=int)
r = np.zeros(n, dtype=int)
for i in range(q):
    l[i], r[i] = map(int, input().split())
print(solve(n, q, s, l, r))

Fixed submission:
import numpy as np

def count(s):
    prev = ""
    cnt = 0
    dp = np.zeros(len(s)+1, dtype=int)
    for i, c in enumerate(s):
        if (prev == "A") and (c == "C"):
            cnt += 1
        prev = c
        dp[i+1] = cnt
    return dp

def solve(n, q, s, l, r):
    dp = count(s)
    for i in range(q):
        print(dp[r[i]] - dp[l[i]])

n, q = map(int, input().split())
s = input()
l = np.zeros(q, dtype=int)
r = np.zeros(q, dtype=int)
for i in range(q):
    l[i], r[i] = map(int, input().split())
solve(n, q, s, l, r)
Buggy python submission (verdict: Runtime Error):
import numpy as np

def solve(n, m, a, b):
    p = [-1] * (n+1)
    u = [1] * (n+1)
    def find(x):
        if p[x] == -1:
            return x
        else:
            return find(p[x])
    def size(x):
        px = find(x)
        return u[px]
    total = n * (n-1) // 2
    res = [total]
    for x, y in zip(a[::-1], b[::-1]):
        px = find(x)
        py = find(y)
        if px != py:
            n1 = size(x)
            n2 = size(y)
            p[py] = px
            u[px] = n1 + n2
            total -= n1 * n2
        res.append(total)
    return res[::-1][1:]

n, m = map(int, input().split())
a = np.zeros(m, dtype=int)
b = np.zeros(m, dtype=int)
for i in range(m):
    a[i], b[i] = map(int, input().split())
print("\n".join(map(str, solve(n, m, a, b))))




Fixed submission:
import numpy as np

def solve(n, m, a, b):
    p = [-1] * (n+1)
    u = [1] * (n+1)
    def find(x):
        if p[x] == -1:
            return x
        else:
            return find(p[x])
    total = n * (n-1) // 2
    res = [total]
    for i in range(m-1, 0, -1):
        x, y = a[i], b[i]
        px = find(x)
        py = find(y)
        if px > py:
            px, py = py, px
        if px != py:
            n1 = u[px]
            n2 = u[py]
            p[py] = px
            u[px] = n1 + n2
            total -= n1 * n2
        res.append(total)
    return res[::-1]

n, m = map(int, input().split())
a = np.zeros(m, dtype=int)
b = np.zeros(m, dtype=int)
for i in range(m):
    a[i], b[i] = map(int, input().split())
print("\n".join(map(str, solve(n, m, a, b))))
Buggy python submission (verdict: Runtime Error):
def solve(n, h):
    dp = [-1] * n
    dp[n-1] = 0
    def f(i):
        if dp[i] == -1:
            dp[i] = min(f(i+k) + abs(h[i+k] - h[i]) for k in [1,2] if (i+k) < n)
        return dp[i]
    return f(0)

n = input()
h = map(int, raw_input().split())
print(solve(n, h))

Fixed submission:
def solve(n, h):
    dp = [10**10] * n
    dp[n-1] = 0
    for i in range(n-1, -1, -1):
        for k in [1,2]:
            if i+k < n:
                dp[i] = min(dp[i], dp[i+k] + abs(h[i+k] - h[i]))
    return dp[0]

n = input()
h = map(int, raw_input().split())
print(solve(n, h))
Buggy python submission (verdict: Time Limit Exceeded):
def solve(n, a):
    a = sorted(a)
    return max(f(n, a), f(n, a[::-1]))

def f(n, a):
    a = a.copy()
    b = []
    for i in range(n):
        if (i-1) % 4 < 2:
            v = a.pop(0)
        else:
            v = a.pop()
        if i % 2 == 0:
            b = [v] + b
        else:
            b = b + [v]
    return sum([abs(b[i+1]-b[i]) for i in range(n-1)])

n = int(input())
a = [int(input()) for i in range(n)]
print(solve(n, a))

Fixed submission:
from collections import deque

def solve(n, a):
    a = sorted(a)
    return max(f(n, a), f(n, a[::-1]))

def f(n, a):
    a = deque(a)
    b = deque([])
    for i in range(n):
        if (i-1) % 4 < 2:
            v = a.popleft()
        else:
            v = a.pop()
        if i % 2 == 0:
            b.appendleft(v)
        else:
            b.append(v)
    return sum([abs(b[i+1]-b[i]) for i in range(n-1)])

n = int(input())
a = [int(input()) for i in range(n)]
print(solve(n, a))
Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10**9 + 7
def solve(s):
    n = len(s)
    dp = [[0,0,0,0] for i in range(n+1)]
    dp[0][0] = 1
    for i in range(n):
        t = 2 * int(s[i] == "?") + 1
        for j in range(4):
            dp[i+1][j] = t * dp[i][j]
        if s[i] == "A":
            dp[i+1][1] = (dp[i+1][1] + dp[i][0]) % MOD
        elif s[i] == "B":
            dp[i+1][2] = (dp[i+1][2] + dp[i][1]) % MOD
        elif s[i] == "C":
            dp[i+1][3] = (dp[i+1][3] + dp[i][2]) % MOD
        else:
            dp[i+1][1] = (dp[i+1][1] + dp[i][0]) % MOD
            dp[i+1][2] = (dp[i+1][2] + dp[i][1]) % MOD
            dp[i+1][3] = (dp[i+1][3] + dp[i][2]) % MOD
    return dp[n][3] % MOD

s = input()
print(solve(s))

Fixed submission:
import numpy as np
MOD = 10**9 + 7
def solve(s):
    n = len(s)
    dp = np.zeros((n+1, 4), dtype=int)
    dp[0,0] = 1
    for i in range(n):
        t = 2 * int(s[i] == "?") + 1
        dp[i+1] = t * dp[i] % MOD
        if s[i] == "A":
            dp[i+1,1] += dp[i,0]
        elif s[i] == "B":
            dp[i+1,2] += dp[i,1]
        elif s[i] == "C":
            dp[i+1,3] += dp[i,2]
        else:
            dp[i+1,1:] += dp[i,:-1]
    return dp[n][3] % MOD

s = input()
print(solve(s))

Buggy python submission (verdict: Time Limit Exceeded):
MOD = 10**9 + 7
def solve(s):
    n = len(s)
    dp = [[0,0,0,0] for i in range(n+1)]
    dp[0][0] = 1
    for i in range(n):
        t = 2 * int(s[i] == "?") + 1
        for j in range(4):
            dp[i+1][j] = t * dp[i][j]
        if (s[i] == "A") or (s[i] == "?"):
            dp[i+1][1] = (dp[i+1][1] + dp[i][0]) % MOD
        if (s[i] == "B") or (s[i] == "?"):
            dp[i+1][2] = (dp[i+1][2] + dp[i][1]) % MOD
        if (s[i] == "C") or (s[i] == "?"):
            dp[i+1][3] = (dp[i+1][3] + dp[i][2]) % MOD
    return dp[n][3] % MOD

s = input()
print(solve(s))

Fixed submission:
import numpy as np
MOD = 10**9 + 7
def solve(s):
    n = len(s)
    dp = np.zeros((n+1, 4), dtype=int)
    dp[0,0] = 1
    for i in range(n):
        t = 2 * int(s[i] == "?") + 1
        dp[i+1] = t * dp[i] % MOD
        if s[i] == "A":
            dp[i+1,1] += dp[i,0]
        elif s[i] == "B":
            dp[i+1,2] += dp[i,1]
        elif s[i] == "C":
            dp[i+1,3] += dp[i,2]
        else:
            dp[i+1,1:] += dp[i,:-1]
    return dp[n][3] % MOD

s = input()
print(solve(s))
Buggy python submission (verdict: Time Limit Exceeded):
def g(n, a):
    for i in range(1, 100):
        if a**i > n:
            return a**(i-1)
    return -1

def solve(n):
    if n < 6:
        return n
    a = g(n, 6)
    b = g(n, 9)
    return min(solve(n-a)+1, solve(n-b)+1)

# assert solve(127) == 4
# assert solve(3) == 3
# assert solve(44852) == 16

print solve(input())

Fixed submission:
def g(n, a):
    for i in range(1, 100):
        if a**i > n:
            return a**(i-1)
    return -1

dp = {}
def solve(n):
    if n < 6:
        return n
    if not n in dp:
        a = g(n, 6)
        b = g(n, 9)
        dp[n] = min(solve(n-a)+1, solve(n-b)+1)
    return dp[n]

# assert solve(127) == 4
# assert solve(3) == 3
# assert solve(44852) == 16

print solve(input())
Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    N, C = map(int, raw_input().split())
    xs, vs = [], []
    for i in range(N):
        x, v = map(int, raw_input().split())
        xs.append(x)
        vs.append(v)
    xs, vs = map(list, zip(*sorted(zip(xs, vs), key=lambda _: _[0])))
    a = f(xs, vs, N, C)
    b = f(map(lambda x: C-x, xs[::-1]), vs[::-1], N, C)
    ans = max(a, b)
    return ans

def f(xs, vs, N, C):
    best = 0
    cur = 0
    px = 0
    best_index = -1
    targets = [(best_index, best)]
    for i in range(N):
        x, v = xs[i], vs[i]
        cur += v - abs(x-px)
        if best < cur:
            best_index = i
            best = cur
            targets.append((best_index, best))
        px = x
    for target_index, target in targets:
        cur = target
        if target_index != -1:
            cur -= xs[target_index]
        px = C
        for i in range(N-1, target_index, -1):
            x, v = xs[i], vs[i]
            cur += v - abs(x-px)
            if best < cur:
                best = cur
            px = x
    return best

print solve()

Fixed submission:
def solve():
    N, C = map(int, raw_input().split())
    xs, vs = [], []
    for i in range(N):
        x, v = map(int, raw_input().split())
        xs.append(x)
        vs.append(v)
    xs, vs = map(list, zip(*sorted(zip(xs, vs), key=lambda _: _[0])))
    a = f(xs, vs, N, C)
    b = f(map(lambda x: C-x, xs[::-1]), vs[::-1], N, C)
    ans = max(a, b)
    return ans

def f(xs, vs, N, C):
    ws = []
    best = 0
    cur = 0
    px = C
    for i in range(N-1,-1,-1):
        x, v = xs[i], vs[i]
        cur += v - abs(x-px)
        best = max(best, cur)
        px = x
        ws.append(best)
    ws = ws[::-1]
    best = 0
    cur = 0
    px = 0
    for i in range(N):
        x, v = xs[i], vs[i]
        cur += v - abs(x-px)
        best = max(best, cur)
        if i+1 < N:
            best = max(best, cur+ws[i+1]-x)
        px = x
    return best

print solve()
Buggy python submission (verdict: Runtime Error):
import numpy as np
def f(a, b):
    if a > b:
        a, b = b, a
    t = int(np.sqrt(a*b - 1))
    l = (a*b-1) / (b+1)
    r = (a*b-1) / (b-1)
    if a == b:
        return 2*t
    if (a+1) == b:
        return 2*t-2
    if t*(t+1) < a*b:
        return 2*t-1
    return 2*t-2

q = input()
for i in range(q):
    a, b = map(int, raw_input().split())
    print f(a,b)

Fixed submission:
q=int(raw_input())
for i in range(q):
	a,b=map(int,raw_input().split())
	p=int((a*b-1)**0.5)
	if p*p>a*b-1:
		p=p-1
	r=p*2-1
	if p*p+p>a*b-1:
		r=r-1
	if a==b:
		r=r+1
	print r
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = input()
a = map(int, raw_input().split())
max_i = np.argmax(a)
min_i = np.argmin(a)
ans = []
if abs(a[max_i]) >= abs(a[min_i]):
    for i in range(n):
        ans.append((max_i, i))
    for i in range(n-1):
        ans.append((i, i+1))
else:
    for i in range(n):
        ans.append((min_i, i))
    for i in range(n-1, 0, -1):
        ans.append((i, i-1))
print len(ans)
for x, y in ans:
    print (x+1), (y+1)

Fixed submission:
print len(filter(lambda c: c=="1", raw_input()))

Buggy python submission (verdict: Runtime Error):
import numpy as np
def solve(N, K, A):
    numbers = {}
    for a in A:
        numbers[a] = numbers.get(a, 0) + 1
    M = len(numbers)
    if M <= K:
        return 0
    dp = np.full((M+1, M+1), N, dtype=int)
    dp[0,:] = 0
    for i, n in enumerate(numbers.values()):
        for j in range(M+1):
            if j > 0:
                dp[i+1,j] = min(dp[i+1,j], dp[i,j-1], dp[i,j] + n)
            else:
                dp[i+1,j] = min(dp[i+1,j], dp[i,j] + n)
    return min(dp[M,:K+1])

N, K = map(int, raw_input().split())
A = map(int, raw_input().split())
print solve(N, K, A)

Fixed submission:
print len(filter(lambda c: c=="1", raw_input()))
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations

INF = 10**18

def solve(h, w, c, a):
    v = list(range(10))
    dp = [INF] * 10
    for p in permutations(v):
        cost = 0
        for i in range(10):
            if p[i] == 1:
                break
            cost += c[p[i]][p[i+1]]
        dp[p[0]] = min(dp[p[0]], cost)
    ans = 0
    for r in range(h):
        for c in range(w):
            x = a[r][c]
            if x == -1:
                continue
            ans += dp[x]
    return ans

h, w = map(int, input().split())
c = [list(map(int, input().split())) for i in range(10)]
a = [list(map(int, input().split())) for i in range(h)]
print(solve(h, w, c, a))




Fixed submission:
def solve(h, w, c, a):
    n = 10
    dp = c.copy()
    for k in range(n):
        for i in range(n):
            for j in range(n):
                dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j])
    ans = 0
    for i in range(h):
        for j in range(w):
            x = a[i][j]
            if x == -1:
                continue
            ans += dp[x][1]
    return ans

h, w = map(int, input().split())
c = [list(map(int, input().split())) for i in range(10)]
a = [list(map(int, input().split())) for i in range(h)]
print(solve(h, w, c, a))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, raw_input().split())
x = [map(int, raw_input().split()) for i in range(N)]
ans = 10**30
for i in range(N):
    for j in range(N):
        for k in range(N):
            for l in range(N):
                x0, y0 = x[i]
                x1, y1 = x[j]
                x2, y2 = x[k]
                x3, y3 = x[l]
                x_min = min([x0, x1, x2, x3])
                x_max = max([x0, x1, x2, x3])
                y_min = min([y0, y1, y2, y3])
                y_max = max([y0, y1, y2, y3])
                cnt = 0
                for m in range(N):
                    x4, y4 = x[m]
                    if (x_min <= x4 <= x_max) and (y_min <= y4 <= y_max):
                        cnt += 1
                if cnt >= K:
                    S = (x_max - x_min) * (y_max - y_min)
                    ans = min(S, ans)
print ans

Fixed submission:
n, k = map(int, raw_input().split())
p = [map(int, raw_input().split()) for i in range(n)]
p = sorted(p, key=lambda _: _[0])
ans = 10**30
for b in range(n):
    x_b, y_b = p[b]
    for t in range(n):
        x_t, y_t = p[t]
        if y_t <= y_b:
            continue
        v = filter(lambda _: y_b <= _[1] <= y_t, p)
        for i in range(len(v) - k + 1):
            x_i, y_i = v[i]
            x_j, y_j = v[i+k-1]
            ans = min(ans, (x_j - x_i) * (y_t - y_b))
print ans
Buggy python submission (verdict: Runtime Error):
def solve(a, b, c, d, e, f):
    S = set()
    for x in range(0, f, 100*a):
        for y in range(0, f, 100*b):
            z = x + y
            if 0 < z <= f:
                S.add(z)
    T = set()
    for x in range(0, f, c):
        for y in range(0, f, d):
            z = x + y
            if z <= f:
                T.add(z)
    threshold = e / (100 + e)
    best = 0
    solution = None
    for x in S:
        for y in T:
            z = x + y
            cur = y / z
            if (best < cur <= threshold) and (z <= f):
                best = cur
                solution = (z, y)
    return "%d %d" % solution

a, b, c, d, e, f = map(int, input().split())
print(solve(a, b, c, d, e, f))

Fixed submission:
EPS = 1E-8
def solve(a, b, c, d, e, f):
    threshold = e / (100 + e) + EPS
    best = -1
    for x in range(0, f+1, 100*a):
        for y in range(x, f+1, 100*b):
            if y == 0:
                continue
            for z in range(y, f+1, c):
                for w in range(z, f+1, d):
                    p = w - y
                    cur = p / w
                    if best < cur <= threshold:
                        best = cur
                        solution = (w, p)
    return "%d %d" % solution

a, b, c, d, e, f = map(int, input().split())
print(solve(a, b, c, d, e, f))
Buggy python submission (verdict: Runtime Error):
print max(X-t, 0)

Fixed submission:
X, t = map(int, raw_input().split())
print max(X-t, 0)