Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [float('inf') for _ in range(N)]
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])
    for i in range(2, N):
        k = 1
        for k in range(1, K + 1):
            if 0 > i - k:
                break
            dp[i] = min(dp[i], dp[i - k] + abs(h[i] - h[i - k]))

    print(dp[-1])


main()


Fixed submission:
def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [float('inf') for _ in range(N)]
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])
    for i in range(2, N):
        k = 1
        for k in range(1, K + 1):
            dp[i] = min(dp[i], dp[i - k] + abs(h[i] - h[i - k]))
    print(dp[-1])


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [float('inf') for _ in range(N)]
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])
    for i in range(2, N):
        k = 1
        while i - k > 0 or K >= k:
            dp[i] = min(dp[i], dp[i - k] + abs(h[i] - h[i - k]))
            k += 1

    print(dp[-1])


main()


Fixed submission:
def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [float('inf') for _ in range(N)]
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])
    for i in range(2, N):
        k = 1
        for k in range(1, K + 1):
            dp[i] = min(dp[i], dp[i - k] + abs(h[i] - h[i - k]))
    print(dp[-1])


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [float('inf') for _ in range(N)]
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])
    for i in range(2, N):
        for k in range(1, K + 1):
            dp[i] = min(dp[i], dp[i - k] + abs(h[i] - h[i - k]))

    print(dp[-1])


main()


Fixed submission:
def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    dp = [float('inf') for _ in range(N)]
    dp[0] = 0
    dp[1] = abs(h[0] - h[1])
    for i in range(2, N):
        k = 1
        for k in range(1, K + 1):
            dp[i] = min(dp[i], dp[i - k] + abs(h[i] - h[i - k]))
    print(dp[-1])


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, W = map(int, input().split())
    wl = []
    vl = []
    for _ in range(N):
        w, v = map(int, input().split())
        wl.append(w)
        vl.append(v)
    dp = [[0] * (W + 1) for _ in range(N + 1)]
    for i in range(N):
        for j in range(W + 1):
            if wl[i] > j:
                dp[i + 1][j] = dp[i][j]
            else:
                dp[i + 1][j] = max(dp[i][j], dp[i][j - wl[i]] + vl[i])
    print(dp[N][W])


main()


Fixed submission:
def main():
    N, W = map(int, input().split())
    WV = []
    for _ in range(N):
        w, v = map(int, input().split())
        WV.append((w, v))
    dp = [[0] * (W + 1) for _ in range(N + 1)]
    for i in range(N):
        for j in range(W + 1):
            if j >= WV[i][0]:
                dp[i + 1][j] = max(
                    dp[i][j],
                    dp[i][j - WV[i][0]] + WV[i][1]
                )
            else:
                dp[i + 1][j] = dp[i][j]
    print(dp[-1][-1])


main()
Buggy python submission (verdict: Runtime Error):
def main():
    N, W = map(int, input().split())
    WV = []
    for _ in range(N):
        w, v = map(int, input().split())
        WV.append((w, v))
    dp = [[0] * (W + 1) for _ in range(N + 1)]
    for i in range(N):
        for j in range(W + 1):
            if j >= WV[i][0]:
                dp[i + 1][j] = max(
                    dp[i][j],
                    dp[i][j - WV[i][0]] + WV[i][1]
                )
            else:
                dp[i + 1][j] = dp[i][j]
    print(dp[-1][-1])


main()


Fixed submission:
def main():
    N, W = map(int, input().split())
    Ws = []
    Vs = []
    for _ in range(N):
        w, v = map(int, input().split())
        Ws.append(w)
        Vs.append(v)
    mv = sum(Vs)
    dp = [[float('INF')] * (mv + 1) for _ in range(N + 1)]
    dp[0][0] = 0
    for i in range(N):
        for j in range(mv + 1):
            if Vs[i] > j:
                dp[i + 1][j] = dp[i][j]
            else:
                dp[i + 1][j] = min(dp[i][j], dp[i][j - Vs[i]] + Ws[i])
    ans = 0
    for r in dp:
        for v, w in enumerate(r):
            if W >= w:
                ans = max(ans, v)
    print(ans)


main()
Buggy python submission (verdict: Runtime Error):
def main():
    N, M = list(map(int, input().split()))

    pref = []
    for _ in range(M):
        P, Y = list(map(int, input().split()))
        pref.append((P, Y))

    pref_sorted = sorted(enumerate(pref), key=lambda x: x[1])

    idx = [1 for _ in range(M)]
    res = ['' for _ in range(M)]
    for j, (p, y) in pref_sorted:
        res[j] = str(p).zfill(6) + str(idx[p]).zfill(6)
        idx[p] += 1
    for r in res:
        print(r)


if __name__ == '__main__':
    main()


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

    pref = []
    for _ in range(M):
        P, Y = list(map(int, input().split()))
        pref.append((P, Y))

    pref_sorted = sorted(enumerate(pref), key=lambda x: x[1])

    idx = [1 for _ in range(N)]
    res = ['' for _ in range(M)]
    for j, (p, y) in pref_sorted:
        res[j] = str(p).zfill(6) + str(idx[p - 1]).zfill(6)
        idx[p - 1] += 1
    for r in res:
        print(r)


if __name__ == '__main__':
    main()

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

    pref = []
    for _ in range(M):
        P, Y = list(map(int, input().split()))
        pref.append((P, Y))

    pref_sorted = sorted(enumerate(pref), key=lambda x: x[1])

    res = ['' for _ in range(M)]
    for i in range(1, N + 1):
        c = 1
        for j, (p, y) in pref_sorted:
            if i == p:
                res[j] = str(p).zfill(6) + str(c).zfill(6)
                c += 1
    for r in res:
        print(r)


if __name__ == '__main__':
    main()


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

    pref = []
    for _ in range(M):
        P, Y = list(map(int, input().split()))
        pref.append((P, Y))

    pref_sorted = sorted(enumerate(pref), key=lambda x: x[1])

    idx = [1 for _ in range(N)]
    res = ['' for _ in range(M)]
    for j, (p, y) in pref_sorted:
        res[j] = str(p).zfill(6) + str(idx[p - 1]).zfill(6)
        idx[p - 1] += 1
    for r in res:
        print(r)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    v = list(map(int, input().split()))
    e = [0 for _ in range(10 ** 5)]
    o = [0 for _ in range(10 ** 5)]
    for i in range(0, n, 2):
        e[v[i]] += 1
        o[v[i + 1]] += 1
    ans = 0
    if n == max(e) + max(o):
        ans = n // 2
    else:
        if n // 2 > max(e):
            ans += n // 2 - max(e)
        if n // 2 > max(o):
            ans += n // 2 - max(o)
    print(ans)


main()


Fixed submission:
def main():
    n = int(input())
    v = list(map(int, input().split()))
    e = [0 for _ in range(1, 10 ** 5 + 2)]
    o = [0 for _ in range(1, 10 ** 5 + 2)]
    for i in range(0, n, 2):
        e[v[i]] += 1
        o[v[i + 1]] += 1
    ans = 0
    if len(set(v)) == 1:
        ans = n // 2
    else:
        me = max(e)
        mo = max(o)
        mei = e.index(me)
        moi = o.index(mo)
        if mei == moi:
            e[mei] = 0
            o[moi] = 0
            ans += n - me - max(max(e), max(o))
        else:
            ans = n - max(e) - max(o)
    print(ans)


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


def check(now, k, t, logs, ans):
    if now in logs:
        return ans
    logs.append(now)
    if k == 0:
        return min(ans, t)
    if len(x) > now + 1:
        ans = min(ans, check(now + 1, k - 1, t +
                             abs(x[now + 1] - x[now]), logs[::], ans))
    if now - 1 >= 0:
        ans = min(ans, check(now - 1, k - 1, t +
                             abs(x[now - 1] - x[now]), logs[::], ans))
    return ans


def main():
    ans = abs(sum(x))
    for i, v in enumerate(x):
        ans = min(ans, check(i, k - 1, abs(v), [], ans))
    print(ans)


main()


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

    i = 0
    ans = 10 ** 8 * n
    while i < n - k + 1:
        lr = abs(x[i]) + abs(x[i] - x[i + k - 1])
        rl = abs(x[i + k - 1]) + abs(x[i] - x[i + k - 1])
        i += 1
        ans = min(ans, lr, rl)
    print(ans)


main()

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


def check(now, k, t, logs, ans):
    if now in logs:
        return ans
    logs.append(now)
    if k == 0:
        return min(ans, t)

    if len(x) > now + 1:
        ans = min(ans, check(now + 1, k - 1, t +
                             abs(x[now + 1] - x[now]), logs[::], ans))
    if now - 1 >= 0:
        ans = min(ans, check(now - 1, k - 1, t +
                             abs(x[now - 1] - x[now]), logs[::], ans))
    return ans


def main():
    ans = abs(sum(x))
    for i, v in enumerate(x):
        ans = min(ans, check(i, k - 1, abs(v), [], ans))
    print(ans)


main()


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

    i = 0
    ans = 10 ** 8 * n
    while i < n - k + 1:
        lr = abs(x[i]) + abs(x[i] - x[i + k - 1])
        rl = abs(x[i + k - 1]) + abs(x[i] - x[i + k - 1])
        i += 1
        ans = min(ans, lr, rl)
    print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, M, Q = map(int, input().split())
    LR = [[0 for _ in range(N + 1)] for _ in range((N + 1))]
    for _ in range(M):
        L, R = map(int, input().split())
        LR[L][R] += 1
    ans = []
    for _ in range(Q):
        p, q = map(int, input().split())
        c = 0
        for R in LR[p:]:
            c += sum(R[:q + 1])
        ans.append(c)
    for a in ans:
        print(a)


main()


Fixed submission:
def main():
    N, M, Q = map(int, input().split())
    cs = [[0 for _ in range(N + 1)] for _ in range((N + 1))]
    for _ in range(M):
        L, R = map(int, input().split())
        cs[L][R] += 1
    for i in range(1, N + 1):
        for j in range(1, N + 1):
            cs[i][j] += cs[i - 1][j]
            cs[i][j] += cs[i][j - 1]
            cs[i][j] -= cs[i - 1][j - 1]
    ans = []
    for _ in range(Q):
        p, q = map(int, input().split())
        ans.append(cs[q][q] - cs[q][p - 1] - cs[p - 1][q] + cs[p - 1][p - 1])
    for a in ans:
        print(a)


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, M, Q = map(int, input().split())
    LR = []
    for _ in range(M):
        L, R = map(int, input().split())
        LR.append((L, R))
    ans = []
    for _ in range(Q):
        p, q = map(int, input().split())
        c = 0
        for L, R in LR:
            if p > L or R > q:
                continue
            c += 1
        ans.append(c)
    for a in ans:
        print(a)


main()


Fixed submission:
def main():
    N, M, Q = map(int, input().split())
    cs = [[0 for _ in range(N + 1)] for _ in range((N + 1))]
    for _ in range(M):
        L, R = map(int, input().split())
        cs[L][R] += 1
    for i in range(1, N + 1):
        for j in range(1, N + 1):
            cs[i][j] += cs[i - 1][j]
            cs[i][j] += cs[i][j - 1]
            cs[i][j] -= cs[i - 1][j - 1]
    ans = []
    for _ in range(Q):
        p, q = map(int, input().split())
        ans.append(cs[q][q] - cs[q][p - 1] - cs[p - 1][q] + cs[p - 1][p - 1])
    for a in ans:
        print(a)


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, M = map(int, input().split())
    ab = [[int(i) for i in input().split()] for _ in range(M)]
    ab = sorted(ab, key=lambda x: x[1])
    bd = ['0'] * (N - 1)
    for a, b in ab:
        if bd[a-1:b-1].count('1') == 0:
            bd[b - 2] = '1'
    print(bd.count('1'))


main()


Fixed submission:
def main():
    N, M = map(int, input().split())
    ab = [[int(i) for i in input().split()] for _ in range(M)]
    ab = sorted(ab, key=lambda x: x[1])
    last = ab[0][1] - 1
    ans = 1
    for a, b in ab[1:]:
        if last >= a:
            continue
        ans += 1
        last = b - 1
    print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    s = input()
    K = int(input())
    alp = 'abcdefghijklmnopqrstuvwxyz'
    sk = []
    for a in alp:
        for i in range(len(s)):
            c = s[i]
            if a != c:
                continue
            for j in range(1, K + 1):
                ss = s[i:i + j]
                if ss not in sk:
                    sk.append(ss)
    print(sorted(sk)[K - 1])


main()


Fixed submission:
def main():
    s = input()
    K = int(input())
    sk = []
    for i in range(len(s)):
        for j in range(1, K + 1):
            ss = s[i:i + j]
            if ss not in sk:
                sk.append(ss)
    print(sorted(sk)[K - 1])


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    if n == 2:
        print(a[0], a[1])
    ma = max(a)
    for i in range(n):
        if ma // 2 - i in a:
            print(ma, ma // 2 - i)
            exit()
        if ma // 2 - i + 1 in a:
            print(ma, ma // 2 - i + 1)
            exit()


main()


Fixed submission:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    if n == 2:
        print(max(a), min(a))
    else:
        ma = max(a)
        sa = sorted([(i, abs(ma // 2 - a[i]))
                     for i in range(n)], key=lambda x: x[1])
        print(ma, a[sa[0][0]])


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    if n == 2:
        print(a[0], a[1])
    for i in range(n):
        if max(a) // 2 - i in a:
            print(max(a), max(a) // 2 - i)
            exit()
        if max(a) // 2 - i + 1 in a:
            print(max(a), max(a) // 2 - i + 1)
            exit()


main()


Fixed submission:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    if n == 2:
        print(max(a), min(a))
    else:
        ma = max(a)
        sa = sorted([(i, abs(ma // 2 - a[i]))
                     for i in range(n)], key=lambda x: x[1])
        print(ma, a[sa[0][0]])


main()
Buggy python submission (verdict: Time Limit Exceeded):
def f(blue, red, ans):
    c = 0
    for i, b in enumerate(blue):
        for j, r in enumerate(red):
            if b[0] >= r[0] and b[1] >= r[1]:
                blue.pop(i)
                red.pop(j)
                c = max(c, f(blue, red, ans + 1))
                blue.insert(i, b)
                red.insert(j, r)
    return max(c, ans)


def main():
    N = int(input())
    red = [list(map(int, input().split())) for _ in range(N)]
    blue = [list(map(int, input().split())) for _ in range(N)]
    print(f(blue, red, 0))


main()


Fixed submission:
def main():
    N = int(input())
    red = sorted(
        [list(map(int, input().split())) for _ in range(N)],
        key=lambda x: x[1],
        reverse=True
    )
    blue = sorted(
        [list(map(int, input().split())) for _ in range(N)],
        key=lambda x: x[0]
    )
    ans = 0
    for b in blue:
        for i, r in enumerate(red):
            if b[0] > r[0] and b[1] > r[1]:
                ans += 1
                red.pop(i)
                break
    print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    csf = []
    for _ in range(N - 1):
        C, S, F = map(int, input().split())
        csf.append((C, S, F))
    
    ans = []
    for i in range(N - 1):
        c, s, _  = csf[i]
        t = c + s
        for ii in range(i + 1, N - 1):
            nc, ns, nf = csf[ii]
            while t > ns:
                ns += nf
            t += nc + ns - t
        ans.append(t)
    ans.append(0)
    
    for t in ans:
        print(t)
    

main()


Fixed submission:
def main():
    N = int(input())
    csf = []
    for _ in range(N - 1):
        C, S, F = map(int, input().split())
        csf.append((C, S, F))
    
    ans = []
    for i in range(N - 1):
        c, s, _  = csf[i]
        t = c + s
        for ii in range(i + 1, N - 1):
            nc, ns, nf = csf[ii]
            if t > ns:
                if (t - ns) % nf == 0:
                    ns += ((t - ns) // nf) * nf
                else:
                    ns += ((t - ns) // nf + 1) * nf
            t += nc + ns - t
        ans.append(t)
    ans.append(0)
    
    for t in ans:
        print(t)
    

main()
Buggy python submission (verdict: Runtime Error):
def main():
    s = input()
    if len(s) % 2 == 1:
        sl = len(s) // 2 + 1
    else:
        sl = len(s) // 2
    ss = s[-sl:sl]
    for i in range(sl, len(s) + 1):
        ss = s[-i - 1] + ss + s[i]
        if ss.count('0') == len(ss) or ss.count('1') == len(ss):
            continue
        print(i)
        return


main()


Fixed submission:
def main():
    s = input()
    i = j = len(s) // 2
    if len(s) % 2 == 0:
        j -= 1
    ss = s[j]
    while len(s) > i and j >= 0 and ss == s[i] and ss == s[j]:
        i += 1
        j -= 1
    print(i)


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, C = map(int, input().split())
    stc = [list(map(int, input().split())) for _ in range(N)]
    st = []
    mxt = 0
    mnt = 0
    while len(stc) > 0:
        s, t, c = stc.pop()
        for i, (ss, tt, cc) in enumerate(stc):
            if c == cc:
                if s == tt:
                    stc.pop(i)
                    stc.append((ss, t, c))
                    break
                elif ss == t:
                    stc.pop(i)
                    stc.append((s, tt, c))
                    break
        else:
            mnt = min(mnt, s - 1)
            mxt = max(mxt, t)
            st.append((s - 1, t))
    cs = [0] * (mxt + 1)
    for s, t in st:
        cs[s] += 1
        cs[t] += -1
    ans = 0
    cc = 0
    for c in cs:
        cc += c
        ans = max(ans, cc)
    print(ans)


main()


Fixed submission:
def main():
    N, C = map(int, input().split())
    stc = [[0] * (10 ** 5) for _ in range(C)]
    for _ in range(N):
        s, t, c = map(int, input().split())
        stc[c - 1][s - 1:t] = [1] * (t - s + 1)
    print(max(map(sum, zip(*stc))))


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, C = map(int, input().split())
    stc = [list(map(int, input().split())) for _ in range(N)]
    st = []
    mxt = 0
    mnt = 0
    while len(stc) > 0:
        s, t, c = stc.pop()
        for i, (ss, tt, cc) in enumerate(stc):
            if c == cc:
                if s == tt:
                    stc.pop(i)
                    stc.append((ss, t, c))
                    break
                elif ss == t:
                    stc.pop(i)
                    stc.append((s, tt, c))
                    break
        else:
            mnt = min(mnt, s - 1)
            mxt = max(mxt, t)
            st.append((s - 1, t))
    ans = 0
    for i in range(mnt, mxt + 1):
        ans = max(ans, sum(1 for s, t in st if s < i <= t))
    print(ans)


main()


Fixed submission:
def main():
    N, C = map(int, input().split())
    stc = [[0] * (10 ** 5) for _ in range(C)]
    for _ in range(N):
        s, t, c = map(int, input().split())
        stc[c - 1][s - 1:t] = [1] * (t - s + 1)
    print(max(map(sum, zip(*stc))))


main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    la = 2
    lb = 1
    for _ in range(N - 1):
        lc = la + lb
        la = lb
        lb = lc
    print(lc)


main()


Fixed submission:
def main():
    N = int(input())
    la = 2
    lb = 1
    for _ in range(N):
        lc = la + lb
        la = lb
        lb = lc
    print(la)


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

    ans = 0
    for a in A:
        for b in B:
            if a >= b:
                break
            for i, c in enumerate(C):
                if c > b:
                    ans += N - i
                    break
    print(ans)


main()


Fixed submission:
import bisect


def main():
    N = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(int, input().split())))

    ans = 0
    for b in B:
        ans += bisect.bisect_left(A, b) * (N - bisect.bisect_right(C, b))
    print(ans)


main()

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

    ans = 0
    for a in A:
        for b in B:
            if a >= b:
                continue
            for c in C:
                if c > b:
                    ans += 1
    print(ans)


main()


Fixed submission:
import bisect


def main():
    N = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(int, input().split())))

    ans = 0
    for b in B:
        ans += bisect.bisect_left(A, b) * (N - bisect.bisect_right(C, b))
    print(ans)


main()
Buggy python submission (verdict: Runtime Error):
def main():
    A, B, C, D, E, F = map(int, input().split())
    xl = []
    yl = []
    for i in range(F):
        for j in range(F):
            x = 100 * A * i + 100 * B * j
            if F >= x and x not in xl:
                xl.append(x)
    for i in range(F):
        for j in range(F):
            y = C * i + D * j
            if F >= y and y not in yl:
                yl.append(y)
    ax = float('INF')
    ay = 0
    for x in xl:
        for y in yl:
            if F >= x + y and E / (E + 100) >= y / (x + y) and y / (x + y) > ay / (ax + ay):
                ax = x
                ay = y
    print(ax + ay, ay, end=' ')


main()


Fixed submission:
def main():
    A, B, C, D, E, F = map(int, input().split())
    xl = []
    yl = []
    for i in range(31):
        for j in range(31):
            x = 100 * A * i + 100 * B * j
            if F >= x and x > 0 and x not in xl:
                xl.append(x)
    for i in range(F):
        for j in range(F):
            y = C * i + D * j
            if F >= y and y > 0 and y not in yl:
                yl.append(y)
    ax = 3001
    ay = 0
    for x in xl:
        for y in yl:
            if F >= x + y and E / (E + 100) >= y / (x + y) and y / (x + y) > ay / (ax + ay):
                ax = x
                ay = y
    if ax == 3001:
        print(100 * A, 0, end=' ')
    else:
        print(ax + ay, ay, end=' ')


main()