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

H, W = map(int, input().split())
S = [0]*H
for i in range(H):
    S[i] = input()
# print(H, W, S)


def is_inside(w, h, W, H):
    if w >= 0 and w < W and h >= 0 and h < H:
        return True
    return False

def solve(sh, sw):
    T = [[0]* W for h in range(H)]
    for i in range(H):
        for j in range(W):
            if S[i][j] == '#':
                T[i][j] = -1
    V = deque([(sh, sw)])
    T[sh][sw] = -2
    while len(V) != 0:
        v = V.popleft()
        h = v[0]
        w = v[1]
        # print(h, w)
        t = T[h][w]
        if t == -2:
            t = 0
        if is_inside(h - 1, w, H, W):
            if T[h - 1][w] == 0:
                T[h - 1][w] = t + 1
                V.append((h - 1, w))
        if is_inside(h + 1, w, H, W):
            if T[h + 1][w] == 0:
                T[h + 1][w] = t + 1
                V.append((h + 1, w))
        if is_inside(h, w - 1, H, W):
            if T[h][w - 1] == 0:
                T[h][w - 1] = t + 1
                V.append((h , w - 1))
        if is_inside(h, w + 1, H, W):
            if T[h][w + 1] == 0:
                T[h][w + 1] = t + 1
                V.append((h , w + 1))
    # print(sh, sw, T)
    return T


ans = 0

for h in range(H):
    for w in range(W):
        T = solve(h, w)
        distance = 0
        for i in range(H):
            for j in range(H):
                d = T[i][j]
                distance = max(distance, d)
        ans = max(distance, ans)

print(ans)


Fixed submission:
from collections import deque

H, W = map(int, input().split())
S = [0]*H
for i in range(H):
    S[i] = input()
# print(H, W, S)


def is_inside(w, h, W, H):
    if w >= 0 and w < W and h >= 0 and h < H:
        return True
    return False

def solve(sh, sw):
    T = [[0]* W for h in range(H)]
    for i in range(H):
        for j in range(W):
            if S[i][j] == '#':
                T[i][j] = -1
    if T[sh][sw] == -1:
        return T
    V = deque([(sh, sw)])
    T[sh][sw] = -2
    while len(V) != 0:
        v = V.popleft()
        h = v[0]
        w = v[1]
        # print(h, w)
        t = T[h][w]
        if t == -2:
            t = 0
        if is_inside(h - 1, w, H, W):
            if T[h - 1][w] == 0:
                T[h - 1][w] = t + 1
                V.append((h - 1, w))
        if is_inside(h + 1, w, H, W):
            if T[h + 1][w] == 0:
                T[h + 1][w] = t + 1
                V.append((h + 1, w))
        if is_inside(h, w - 1, H, W):
            if T[h][w - 1] == 0:
                T[h][w - 1] = t + 1
                V.append((h , w - 1))
        if is_inside(h, w + 1, H, W):
            if T[h][w + 1] == 0:
                T[h][w + 1] = t + 1
                V.append((h , w + 1))
    # print(sh, sw, T)
    return T


ans = 0

for h in range(H):
    for w in range(W):
        T = solve(h, w)
        distance = 0
        for i in range(H):
            for j in range(W):
                d = T[i][j]
                distance = max(distance, d)
        ans = max(distance, ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    S = input()
    ans = 0
    for i in range(1000):
        d0 = str(i % 10)
        d1 = str((i // 10) % 10)
        d2 = str((i // 100) % 10)
        j = 0
        found = False
        while j < N:
            if S[j] == d0:
                found = True
                j += 1
                break
            j += 1
        if not found:
            continue
        found = False
        while j < N:
            if S[j] == d1:
                found = True
                j += 1
                break
            j += 1
        if not found:
            continue
        found = False
        while j < N:
            if S[j] == d2:
                found = True
                j += 1
                break
            j += 1
        if not found:
            continue
        if found:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N = int(input())
    S = input()
    ans = 0
    for i in range(1000):
        d0 = str(i % 10)
        d1 = str((i // 10) % 10)
        d2 = str((i // 100) % 10)
        j = 0
        found = False
        while j < N:
            if S[j] == d0:
                found = True
                j += 1
                break
            j += 1
        if not found:
            continue
        found = False
        while j < N:
            if S[j] == d1:
                found = True
                j += 1
                break
            j += 1
        if not found:
            continue
        found = False
        while j < N:
            if S[j] == d2:
                found = True
                j += 1
                break
            j += 1
        if not found:
            continue
        if found:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
m = 10**9 + 7
X, Y = map(int, input().split())
t = [[0] * (X + 2) for i in range(Y + 2)]
for i in range(Y):
    for j in range(X):
        t[i + 1][j + 2] += t[i][j] + 1
        t[i + 2][j + 1] += t[i][j] + 1
        t[i + 1][j + 2] %= m
        t[i + 2][j + 1] %= m

print(t[Y - 1][X - 1])


Fixed submission:
def gcd1(a, b):
    def calc(a, b, first, second):
        if a < b:
            a, b = b, a
        r = a % b
        q = -(a - r)//b
        if r == 0:
            return b, second
        # first += q * second
        first = [x + q * y for (x, y) in zip(first, second)]
        return calc(r, b, second, first)
    first = [1, 0]
    second = [0, 1]
    return calc(a, b, first, second)

def mod_inv(n, mod):
    table = gcd1(n, mod)
    inv = table[1][1]
    if inv < 0:
        inv += mod
    return inv

def cmb(n, r, mod):
    ans = 1
    for i in range(r):
        ans = (ans * n) % mod
        n -= 1
    ans1 = 1
    for i in range(1, r + 1):
        ans1 = (ans1 * i) % mod
    return ans * mod_inv(ans1, mod)

def main():
    m = 10**9 + 7
    X, Y = map(int, input().split())
    XY = X + Y
    min_xy = XY // 3
    max_xy = XY - min_xy
    if XY % 3 != 0:
        print(0)
        return
    if X < min_xy or X > max_xy or Y < min_xy or Y > max_xy:
        print(0)
        return
    index_x = X - min_xy
    index_y = Y - min_xy
    # print(index_x, index_y)
    ans = cmb(min_xy, index_x, m)
    print(ans % m)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))

class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        ret = 0
        while i > 0:
            ret += self.tree[i]
            i -= i & -i
        return ret

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

bit = Bit(N)

inter = 0
intra = 0
for i in range(len(A)):
    a = A[i]
    bit.add(a, 1)
    s_a = bit.sum(a)
    intra += i + 1 - s_a
    if a == 1:
        continue
    inter += bit.sum(a - 1)

mod = 10**9 + 7

ans = (intra * K * (K + 1) // 2) % mod
ans += inter * (K - 1) * K // 2 % mod
ans %= mod
print(ans)


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

mod = 10**9 + 7
B = [0]*N
for i in range(N):
    ai = A[i]
    for j in range(i, N):
        aj = A[j]
        if ai > aj:
            B[i] += 1

C = [0]*N
for i in range(N):
    ai = A[i]
    for j in range(i+1):
        aj = A[j]
        if ai > aj:
            C[i] += 1

# print(B)
# print(C)
ans = 0
# for i in range(N):
#     ai = A[i]
#     for j in range(i + 1, N):
#         aj = A[j]
#         # print(i, j, ai, aj)
#         if ai > aj:
#             ans += 1

for i in range(N):
    ans += B[i]*K*(K+1)//2
    ans %= mod

for i in range(N):
    ans += C[i]*(K-1)*K//2
    ans %= mod

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
for i in range(N):
    S.append(input())
# print(N, S)

for i in range(len(S)):
    s = S[i]
    t = list(s)
    t.sort()
    S[i] = ''.join(t)

# print(S)
ans = 0
for i in range(N):
    si = S[i]
    for j in range(i + 1, N):
        sj = S[j]
        if si == sj:
            # print(i, j, si, sj)
            ans += 1

print(ans)


Fixed submission:
# import itertools

N = int(input())
S = []
for i in range(N):
    S.append(input())
# print(N, S)

for i in range(len(S)):
    s = S[i]
    t = list(s)
    t.sort()
    S[i] = ''.join(t)

S.sort()
# print(S)

ans = 0
i = 0
count = 0
while i < N - 1:
    si = S[i]
    sj = S[i + 1]
    if si != sj:
        # print(si, i, count)
        ans += count * (count + 1) // 2
        count = 0
    else:
        count += 1
        if i == N - 2:
            ans += count * (count + 1) // 2
    i += 1

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

# print(N, A)
B = [0]*N

for i in range((N + 1)//2, N + 1):
    B[i - 1] = A[i - 1]

for i in range(N // 2):
    index = N // 2 - i - 1
    num = 0
    for j in range(N):
        v = N - j - 1
        if (v + 1) % (index + 1) == 0:
            num += B[v]
    if num % 2 != A[index]:
        B[index] = 1
# print(B)

M = 0
for b in B:
    if b == 1:
        M += 1
print(M)
ANS = []
for i in range(N):
    if B[i] == 1:
        ANS.append(str(i + 1))
if M > 0:
    ans = ' '.join(ANS)
    print(ans)


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

# print(N, A)
B = [0]*N

for i in range(N//2 + 1, N + 1):
#     print(i, A[i - 1])
    B[i - 1] = A[i - 1]

for i in range(N // 2):
    index = N // 2 - i - 1
    num = 0
#     print(index)
    for j in range(1, N // (index + 1) + 1):
        v = j * (index + 1) - 1
        num += B[v]
        # print(v, B[v])
#     print(index, num)
    if num % 2 != A[index]:
        B[index] = 1
# print(B)

M = 0
for b in B:
    if b == 1:
        M += 1
print(M)
ANS = []
for i in range(N):
    if B[i] == 1:
        ANS.append(str(i + 1))
if M > 0:
    ans = ' '.join(ANS)
    print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
# print(N, A)

ans = list(set(A))
if len(ans) > 3:
    print('No')
    exit()

a0 = ans[0]
a1 = ans[1]
a2 = ans[2]

if a0 ^ a1 == a2:
    print('Yes')
else:
    print('No')


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

ans = list(set(A))
l = len(ans)
if l > 3:
    print('No')
    exit()

if l == 1:
    if ans[0] == 0:
        print('Yes')
    else:
        print('No')
    exit()

if l == 2:
    a0 = ans[0]
    a1 = ans[1]
    num_a0 = A.count(ans[0])
    num_a1 = A.count(ans[1])
    if a0 != 0 and a1 != 0:
        print('No')
        exit()
    num_0 = num_a0 if a0 == 0 else num_a1
    num_n0 = num_a1 if a0 == 0 else num_a0
    if num_0 * 2 == num_n0:
        print('Yes')
    else:
        print('No')
    exit()

a0 = ans[0]
a1 = ans[1]
a2 = ans[2]

if a0 ^ a1 != a2:
    print('No')
    exit()

num_a0 = A.count(ans[0])
num_a1 = A.count(ans[1])
num_a2 = A.count(ans[2])

if num_a0 != num_a1 or num_a0 != num_a2:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

# A = list(map(int, input().split()))
# print(N, A)
A = []
l = input().split()
total = 0
sub = 0
for i in range(len(l)):
    v = int(l[i])
    A.append(v)
    total += v
    if i % 2 == 1:
        sub += v

M = [0]*N
# total = sum(A)
# sub = 0
# for i in range((N-1)//2):
#     sub += A[2*i + 1]
# print(total, sub)
M[0] = total - 2 * sub
ans = "{} ".format(M[0])
for i in range(1, N):
    m = 2 * A[i - 1] - M[i - 1]
    M[i] = m
    ans += str(m) + " "
# print(M)
print(ans[0:-1])


Fixed submission:
N = int(input())

# A = list(map(int, input().split()))
# print(N, A)
A = []
l = input().split()
total = 0
sub = 0
for i in range(len(l)):
    v = int(l[i])
    A.append(v)
    total += v
    if i % 2 == 1:
        sub += v

M = [0]*N
# total = sum(A)
# sub = 0
# for i in range((N-1)//2):
#     sub += A[2*i + 1]
# print(total, sub)
M[0] = total - 2 * sub
for i in range(1, N):
    m = 2 * A[i - 1] - M[i - 1]
    M[i] = m
# print(M)
ans = " ".join(map(str, M))
print(ans)

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

M = [0]*N
total = sum(A)
sub = 0
for i in range((N-1)//2):
    sub += A[2*i + 1]
# print(total, sub)
M[0] = total - 2 * sub
for i in range(1, N):
    M[i] = 2 * A[i - 1] - M[i - 1]
# print(M)
ans = ""
for m in M:
    ans += str(m) + " "
print(ans[0:-1])


Fixed submission:
N = int(input())

# A = list(map(int, input().split()))
# print(N, A)
A = []
l = input().split()
total = 0
sub = 0
for i in range(len(l)):
    v = int(l[i])
    A.append(v)
    total += v
    if i % 2 == 1:
        sub += v

M = [0]*N
# total = sum(A)
# sub = 0
# for i in range((N-1)//2):
#     sub += A[2*i + 1]
# print(total, sub)
M[0] = total - 2 * sub
for i in range(1, N):
    m = 2 * A[i - 1] - M[i - 1]
    M[i] = m
# print(M)
ans = " ".join(map(str, M))
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
# print(N, K)

def print_simple(N, K, simple_max_edges):
    remain = simple_max_edges - K
    print(4 + remain)
    for i in range(1, N):
        print(i, i + 1)

    for i in range(1, N - 1):
        if remain == 0:
            break
        print(i, i + 2)
        remain -= 1

simple_max_edges = N - 2
if K <= simple_max_edges:
    print_simple(N, K, simple_max_edges)
    exit()

max_edges = (N - 2) * (N - 1) // 2
if max_edges < K:
    print(-1)
    exit()

print(4 + remain)
for i in range(2, N + 1):
    print(1, i)

remain = max_edges - K
for i in range(2, N + 1):
    if remain == 0:
        break
    print(i, i + 1)
    remain -= 1


Fixed submission:
N, K = map(int, input().split())
# print(N, K)

max_edges = (N - 2) * (N - 1) // 2
if max_edges < K:
    print(-1)
    exit()

remain = max_edges - K
print(N - 1 + remain)
for i in range(2, N + 1):
    print(1, i)

for i in range(2, N + 1):
    if remain <= 0:
        break
    for j in range(i + 1, N + 1):
        if remain <= 0:
            break
        print(i, j)
        remain -= 1
Buggy python submission (verdict: Runtime Error):
l = input().split()
N = int(l[0])
K = int(l[1])

l = input().split()
s = 0
A = []
for i in range(N):
    a = int(l[i])
    s += a
    A.append(a)

B = []
s1 = 0
for i in range(N):
    B.append(s - s1)
    s1 += A[i]
B.append(0)

# print(N, K, A, B)

ans = 0
for i in range(N):
    b = B[i]
    if b < K:
        break
    small = 0
    large = N
    j = (small + large)//2
    while True:
        index = N - 1 - j
        # print(i, j, b, index, B[index], B[index + 1], small, large)
        if b - B[index] < K and b - B[index + 1] >= K:
            # print(ans, i, j)
            ans += j + 1
            break
        if b - B[index] < K:
            large = j
            j = (small + large)//2
        else:
            small = j
            j = (small + large)//2

print(ans)


Fixed submission:
l = input().split()
X = int(l[0])
A = int(l[1])

if X < A:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Time Limit Exceeded):
l = input().split()
N = int(l[0])
M = int(l[1])

A = []
for i in range(M):
    l = input().split()
    A.append(int(l[0]))

mod = 1000000007

# print(N, M, A)

DP = [0]*(N+2)
DP[0] = 1
for i in range(N):
    if i in A:
        continue
    DP[i + 1] = (DP[i] + DP[i + 1]) % mod
    DP[i + 2] = (DP[i] + DP[i + 2]) % mod
print(DP[N])


Fixed submission:
N, M = map(int, input().split())
DP = [0]*(N+2)
DP[0] = 1
A = []
for i in range(M):
    a = int(input())
    DP[a] = -1

mod = 1000000007

# print(N, M, A)

for i in range(N):
    if DP[i] == -1:
        continue
    if DP[i + 1] != -1:
        DP[i + 1] = (DP[i] + DP[i + 1]) % mod
    if DP[i + 2] != -1:
        DP[i + 2] = (DP[i] + DP[i + 2]) % mod
print(DP[N])
Buggy python submission (verdict: Runtime Error):
l = raw_input().split()
N = int(l[0])
M = int(l[1])

L = []
R = []

for i in range(M):
    l = raw_input().split()
    L.append(int(l[0]))
    R.append(int(l[1]))

l = max(L)
#r = min(R)
print(l, r)
if l > r:
    print(0)
else:
    print(r - l + 1)


Fixed submission:
l = raw_input().split()
N = int(l[0])
M = int(l[1])

L = []
R = []

for i in range(M):
    l = raw_input().split()
    L.append(int(l[0]))
    R.append(int(l[1]))

l = max(L)
r = min(R)
# print(l, r)
if l > r:
    print(0)
else:
    print(r - l + 1)
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from functools import reduce
N = int(input())
A = list(map(int, input().split()))

def solve(A, i):
    ans = A[0]
    if i == 0:
        ans = A[1]
    for j in range(len(A)):
        if j == i:
            continue
        ans = gcd(ans, A[j])
    return ans

# print(N, A)
B = []
for i in range(len(A)):
    B.append(solve(A, i))

print(max(B))


Fixed submission:
from fractions import gcd
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
# print(N, A)

L = [0]*(N - 1)
R = [0]*(N - 1)
L[0] = A[0]
R[0] = A[-1]

for i in range(1, N - 1):
    L[i] = gcd(L[i - 1], A[i])
    R[i] = gcd(R[i - 1], A[-1 - i])

# print(L)
# print(R)

B = [R[-1]]
for i in range(N - 2):
    l = L[i]
    r = R[N - 3 - i]
    # print(l, r)
    B.append(gcd(l, r))
B.append(L[-1])

# print(B)
ans = max(B)
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

M = []
N = []
for i in range(5):
    l = int(raw_input().split()[0])
    if l % 10 == 0:
        M.append(l)
    else:
        N.append(l)
N = sorted(N,  key=lambda x: 10 - (x % 10))
# print(M, N)

ret = 0
for m in M:
    ret += m
for n in N:
    ret += n
    ret += (10 - (n % 10))
ret -= (10 - (N[-1] % 10))
print(ret)


Fixed submission:
import sys

M = []
N = []
for i in range(5):
    l = int(raw_input().split()[0])
    if l % 10 == 0:
        M.append(l)
    else:
        N.append(l)
N = sorted(N,  key=lambda x: 10 - (x % 10))
# print(M, N)

ret = 0
for m in M:
    ret += m
for n in N:
    ret += n
    ret += (10 - (n % 10))
if len(N) != 0:
    ret -= (10 - (N[-1] % 10))
print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

l = raw_input().split()
N = int(l[0])
Q = int(l[1])
l = raw_input().split()
S = l[0]

L = [0]*Q
R = [0]*Q

ac = 'AC'

for i in range(Q):
    l = raw_input().split()
    L[i] = int(l[0])
    R[i] = int(l[1])

#print(N,Q,S,L,R)

def count(S):
    length = len(S)
    c = 0
    for i in range(length - 1):
        # print(S[i:i+2])
        if ac == S[i:i+2]:
            c += 1
    return c

table = [0]*len(S)

for i in range(len(S)):
    table[i] = count(S[i:])

for i in range(Q):
    print(table[L[i]-1] - table[R[i]-1])


Fixed submission:
import sys

l = raw_input().split()
N = int(l[0])
Q = int(l[1])
l = raw_input().split()
S = l[0]

L = [0]*Q
R = [0]*Q

ac = 'AC'

for i in range(Q):
    l = raw_input().split()
    L[i] = int(l[0])
    R[i] = int(l[1])

#print(N,Q,S,L,R)

def count(S, table):
    length = len(S)
    c = 0
    for i in range(length - 1):
        # print(S[i:i+2])
        if ac == S[length - i - 2:length - i]:
            c += 1
        table[i+1] = c

length_S = len(S)
table = [0]*length_S

count(S, table)
# print(table)

for i in range(Q):
    print(table[length_S - L[i]] - table[length_S - R[i]])

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

l = raw_input().split()
N = int(l[0])
Q = int(l[1])
l = raw_input().split()
S = l[0]

L = [0]*Q
R = [0]*Q

ac = 'AC'

for i in range(Q):
    l = raw_input().split()
    L[i] = int(l[0])
    R[i] = int(l[1])

#print(N,Q,S,L,R)

def count(S):
    length = len(S)
    c = 0
    for i in range(length - 1):
        # print(S[i:i+2])
        if ac == S[i:i+2]:
            c += 1
    return c

for i in range(Q):
    p = S[L[i]-1:R[i]]
    # print(p)
    print(count(p))


Fixed submission:
import sys

l = raw_input().split()
N = int(l[0])
Q = int(l[1])
l = raw_input().split()
S = l[0]

L = [0]*Q
R = [0]*Q

ac = 'AC'

for i in range(Q):
    l = raw_input().split()
    L[i] = int(l[0])
    R[i] = int(l[1])

#print(N,Q,S,L,R)

def count(S, table):
    length = len(S)
    c = 0
    for i in range(length - 1):
        # print(S[i:i+2])
        if ac == S[length - i - 2:length - i]:
            c += 1
        table[i+1] = c

length_S = len(S)
table = [0]*length_S

count(S, table)
# print(table)

for i in range(Q):
    print(table[length_S - L[i]] - table[length_S - R[i]])
Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9 + 7

def solve(n, A, index):
    if n == 1:
        s = 0
        for i in range(index, len(A)):
            s += A[i][1]
        # print(index, A[index:], s)
        return s
    ans = 0
    for i in range(index, len(A)):
        a = A[i]
        ans = (ans + a[1] * solve(n - 1, A, i + 1)) % mod
    return ans

def main():
    N = int(input())
    S = input()
    num_chars = 0
    A = {}
    for s in S:
        if s not in A:
            A[s] = 0
            num_chars += 1
        A[s] += 1
    # print(num_chars, A)
    B = [(a, A[a]) for a in A]

    ans = 0
    for i in range(num_chars):
        ans = (ans + solve(i + 1, B, 0)) % mod
        # print(ans)
    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
mod = 10**9 + 7

def main():
    N = int(input())
    S = input()
    num_chars = 0
    A = {}
    for s in S:
        if s not in A:
            A[s] = 0
            num_chars += 1
        A[s] += 1
    # print(num_chars, A)
    B = [(a, A[a]) for a in A]

    ans = 1
    for b in B:
        ans = (ans * (b[1] + 1)) % mod
    print(ans - 1)

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

args = sys.argv
a = int(args[1])
b = int(args[2])
c = int(args[3])

ret = int(b/a)
if ret >= c:
    ret =c

print(ret)


Fixed submission:
import sys

l = raw_input().split()
a = int(l[0])
b = int(l[1])
c = int(l[2])

ret = int(b/a)
if ret >= c:
    ret =c

print(ret)