Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(int, input().split(" ")))

c = [0] * (n+1)
j = 0
if 1 not in s:
    print(-1)
elif len(s) == 1:
    print(0)
else:
    for i in range(1,n+1):
        if i in s:
            c[i] = s.index(i)
            del s[j:c[i]]
            j += 1
            #print(s)
        elif i not in s:
            break
    print(n - j)

Fixed submission:
n = int(input())
s = list(map(int, input().split(" ")))

c = []
j = 0
if 1 not in s:
    print(-1)
elif len(s) == 1:
    print(0)
else:
    for i in s:
        if i - j == 1:
            j = i
            c.append(i)
    print(n - len(c))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(int, input().split(" ")))

c = [0] * (n+1)
j = 0
if 1 not in s:
    print(-1)
elif len(s) == 1:
    print(0)
else:
    for i in range(1,n+1):
        if i in s:
            c[i] = s.index(i)
            del s[j:c[i]]
            j += 1
            #print(s)
        elif i not in s:
            if len(s) == j:
                break
            else:
                while len(s) != j:
                    s.pop()
    print(n - len(s))

Fixed submission:
n = int(input())
s = list(map(int, input().split(" ")))

c = []
j = 0
if 1 not in s:
    print(-1)
elif len(s) == 1:
    print(0)
else:
    for i in s:
        if i - j == 1:
            j = i
            c.append(i)
    print(n - len(c))
Buggy python submission (verdict: Runtime Error):
import math
a, b ,x = list(map(int,input().split()))

if x > a*a*b/2:
    theta = math.atan(2*(a*a*b-x)/a/a/a)
else:
    theta = math.atan(a*a*b/2/x)

print(math.degrees(theta))


Fixed submission:
a,b = map(int,input().split())

if (a >= 10) or (b >= 10):
  print(-1)
else:
  print(a*b)
Buggy python submission (verdict: Runtime Error):
N = int(input(()))
L = list(map(int,input().split()))
count = 0

l = []
for j in range(N-1):
    for i in range(j+1,N):
        for k in range(i+1,N):
            if(L[i]+L[j]>L[k])and(L[i]+L[k]>L[j])and(L[i]<L[j]+L[k]):
                l.append([i,j,k])
                if [i,j,k] in l:
                    continue
                else:
                    count += 1
print(count)

Fixed submission:
A,B = map(int,input().split())
if A < 2*B:
  print(0)
else:
  print(A-2*B)

Buggy python submission (verdict: Runtime Error):
N = int(input(()))
L = list(map(int,input().split()))
count = 0

l = []
for j in range(N-1):
    for i in range(j+1,N):
        for k in range(i+1,N):
            if(L[i]+L[j]>L[k])and(L[i]+L[k]>L[j])and(L[i]<L[j]+L[k]):
                l.append([i,j,k])
                if([i,j,k] in l):
                    count += 1
print(count)
print(l)


Fixed submission:
A,B = map(int,input().split())
if A < 2*B:
  print(0)
else:
  print(A-2*B)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split(' '))
a = list(map(int, input().split(' ')))


if n == 1:
    ans = a[0]//(2**m)
    print(ans)

else:
    for i in range(m):
        l = max(a)
        c = a.index(l)
        a[c] = a[c]//2
    print(sum(a))

Fixed submission:
import heapq
n, m = map(int, input().split())
a = []
for i in list(map(int, input().split())):
    heapq.heappush(a,-i)

for _ in range(m):
    p = heapq.heappop(a)
    heapq.heappush(a, int(p/2))

print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
a.sort()
a.reverse()

if n == 1:
    ans = a[0]//(2**m)
    print(ans)
    exit()
while m > 0:
    for i in range(0,n):
        l = max(a)
        if a[i] > l//2:
            if m - 1 >= 0:
                a[i] = a[i]//2
            m -= 1
        else:
            break
print(sum(a))

Fixed submission:
import heapq
n, m = map(int, input().split())
a = []
for i in list(map(int, input().split())):
    heapq.heappush(a,-i)

for _ in range(m):
    p = heapq.heappop(a)
    heapq.heappush(a, int(p/2))

print(-sum(a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
b = list(map(int, input().split()))
a = [-1]*n
for i in range(1,n-1):
    a[i] = min(b[i],b[i-1])
a[0] = a[1]
#print(a)
a[n-1] = max(b[-1],b[-2])
#print(a)
print(sum(a))

Fixed submission:
n = int(input())
b = list(map(int, input().split()))
a = [-1]*n
for i in range(n):
    if i == 0:
        a[i] = b[i]
    elif i < n-1:
        a[i] = min(b[i],b[i-1])
    else:
        a[i] = b[i-1]

print(sum(a))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(" "))

plug = [0] * 50
plug[0] = 1

i = 0
while plug[i] < B:
  i += 1
  plug[i] = plug[i-1] + a - 1
print(i)

Fixed submission:
a, b = map(int, input().split(" "))
i = 0
s = 1
while s < b:
  s += a-1
  i += 1
print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1,n):
    ans += i

print(ans)

Fixed submission:
n = int(input())
ans = (n-1)*n // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1,n):
    ans += i%(i+1)

print(ans)

Fixed submission:
n = int(input())
ans = (n-1)*n // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split(" ")))
for i in range(n):
  ans += 1/a[i]
print(1/ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split(" ")))
ans = 0
for i in range(n):
  ans += 1/a[i]
print(1/ans)
Buggy python submission (verdict: Time Limit Exceeded):
mod = 1000000007
n,m = map(int, input().split(" "))
a = [int(input()) for i in range(m)]
ans = [0]*(n+1)
ans[0] = 1
for j in range(1,n+1):
  if j in a:
    ans[j] = 0
  else:
    ans[j] = ans[j-1] + ans[j-2]
    ans[j] = ans[j]%mod
print(ans[-1])
      

Fixed submission:
mod = 1000000007
n,m = map(int, input().split(" "))
a = set([int(input()) for i in range(m)])
ans = [0]*(n+1)
ans[0] = 1
for j in range(1,n+1):
  if j in a:
    ans[j] = 0
  else:
    ans[j] = (ans[j-1] + ans[j-2])%mod
print(ans[-1])
Buggy python submission (verdict: Runtime Error):
S = input()
cnt=0
ans = 0
sets = set([A,T,C,G])
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)


Fixed submission:
S = input()
cnt=0
ans = 0
sets = {"A","T","C","G"}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
ans = max(ans,cnt)
print(ans)

Buggy python submission (verdict: Runtime Error):
S = input()
cnt=0
ans = 0
sets = {A,T,C,G}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)

Fixed submission:
S = input()
cnt=0
ans = 0
sets = {"A","T","C","G"}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
ans = max(ans,cnt)
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [2*10**4]*n*k
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
      dp[i+j] = min(dp[i+j], dp[i]+abs(h[i+j]-h[i]))
print(dp[n-1])

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [2**60 for i in range(110000)]
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i]+abs(h[i+j]-h[i]))
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()
n = max(len(s),len(t))
dp = [[0]*(n+1) for i in range(n+1)]

for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1)
        dp[i+1][j+1] = max(dp[i+1][j+1],dp[i+1][j])
        dp[i+1][j+1] = max(dp[i+1][j+1],dp[i][j+1])

ans = ""
i = len(s)
j = len(t)
while (i > 0 and j > 0):
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        ans = s[i-1] + ans
        i -= 1
        j -= 1
print(ans)
        

Fixed submission:
s = input()
t = input()
n = max(len(s),len(t))
dp = [[0]*(n+1) for i in range(n+1)]

for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1)
        dp[i+1][j+1] = max(dp[i+1][j+1],dp[i+1][j])
        dp[i+1][j+1] = max(dp[i+1][j+1],dp[i][j+1])

ans = ""
i = len(s)
j = len(t)
while (i > 0 and j > 0):
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        ans = s[i-1] + ans
        i -= 1
        j -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
V = list(map(int,input().split(" ")))
V1 = V[::2]
V2 = V[1::2]
ans = 0
if V1 == V2:
  ans = N//2
else:
  d1 = Counter(V1)
  d2 = Counter(V2)
  m1 = max(d1)
  m2 = max(d2)
  a = d1.pop(m1)
  b = d2.pop(m2)
  if a != b:
    if d1:
      ans += sum(d1.values())
    if d2:
      ans += sum(d2.values())
  else:
    c = max(d1.values())
    d = max(d2.values())
    tmp = N - a - d
    ans = min(tmp,N - b - c)
print(ans)

Fixed submission:
from collections import Counter
N = int(input())
V = list(map(int,input().split(" ")))

V1 = V[::2]
V2 = V[1::2]
ans = 0
d1 = Counter(V1)
d2 = Counter(V2)
if len(d1) == 1 and V1 == V2:
    print(N//2)
    exit()
m1 = max(d1.items(), key = lambda x:x[1])
m2 = max(d2.items(), key = lambda x:x[1])
d1.pop(m1[0])
d2.pop(m2[0])
a = m1[1]
b = m2[1]
if m1[0] != m2[0]:
    if d1:
      ans += sum(d1.values())
    if d2:
      ans += sum(d2.values())
else:
    c = 0
    d = 0
    if d1:
	    c = max(d1.values())
    if d2:
	    d = max(d2.values())
    if c != 0:
        tmp = N-b-c
    if c == 0:
        tmp = N-b-a
    if d != 0:
        ttmp = N-a-d
    if d == 0:
        ttmp = N-a-b
    
    ans = min(tmp,ttmp)
print(ans)
Buggy python submission (verdict: Runtime Error):
mod = 10**9+7
def sieve(N):#エラトステネスの篩
    prime = [0]*(N+1)
    isprime = [True]*(N+1)
    isprime[0]=isprime[1] = False
    num = 0
    for p in range(2,N+1):
        if isprime[p]:
            prime[num] = p
            num += 1
            for j in range(2*p,N+1,p):
                isprime[j] = False
    prime.sort()
    prime.reverse()
    for k in range(N-1):
        if prime[k+1] == 0:
            end = k
            break
    return prime[:end+1]

def comb(n,k):
    n1, k = n+1, min(k, n-k)
    numer = denom = 1
    for i in range(1,k+1):
        numer = numer*(n1-i)
        denom = denom*i
    return numer//denom

def solve():
    N,M = map(int,input().split())
    if M == 1:
        print(1)
    prime = sieve(M)
    prime.sort()
    b = {}
    for i in prime:
        if M%i == 0:
            cnt = 0
            while M%i == 0:
                cnt += 1
                M //= i
            b[i] = cnt
    ans = 1
    for num in b:
        ans *= comb(b[num]+N-1,b[num])
        ans %= mod
    print(ans)

if __name__=="__main__":
    solve()

Fixed submission:
mod = 10**9+7
def prime(n,p):
    iteral = 0
    while n%p == 0:
        n //= p
        iteral += 1
    return iteral,n
def modpow(a,n):#二乗
    if n==0:
        return 1
    elif n==1:
        return a%mod
    elif n%2==0:
        return (modpow(a,n/2)**2)%mod
    else:
        return (a*modpow(a,n-1))%mod
def modfact(l,r):#階乗
    fact=1
    for i in range(l-r+1):
        fact=fact*(r+i)%mod
    return fact
def comb(n,x):#組み合わせ
    S=modfact(n,n-x+1)
    fact=modfact(x,1)
    T=modpow(fact,mod-2)
    return S*T%mod
def main():
    N,M = map(int,input().split())
    b = {}
    for i in range(2,int(M**0.5)+10):
        if M%i==0:
            num,M = prime(M,i)
            b[i] = num
    if M > 1:
        b[M] = 1
    ans = 1
    for num in b:
        ans *= comb(b[num]+N-1,b[num])
        ans %= mod
    print(ans)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
def main():
    N = int(input())
    ans = 0
    s = defaultdict(int)
    for _ in range(N):
        a = input()
        s[a] += 1
    M = int(input())
    for _ in range(M):
        b = input()
        s[b] -= 1
    for v in s.items():
        ans = max(ans,v[1])
    print(ans)
if __name__ == a__main__":
    main()

Fixed submission:
from collections import defaultdict
def main():
    N = int(input())
    ans = 0
    s = defaultdict(int)
    for _ in range(N):
        a = input()
        s[a] += 1
    M = int(input())
    for _ in range(M):
        b = input()
        s[b] -= 1
    for v in s.items():
        ans = max(ans,v[1])
    print(ans)
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int,input().split()))
    B = list(set(A))
    ans = 0
    for v in B:
        tmp = A.count(v)
        if tmp < v:
            ans += tmp
        else:
            ans += tmp-v
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
from collections import defaultdict
def main():
    N = int(input())
    d = defaultdict(int)
    ans = 0
    for a in tuple(map(int,input().split())):
        d[a] += 1
    for v in d.items():
        if v[0] > v[1]:
            ans += v[1]
        else:
            ans += v[1]-v[0]
    print(ans)
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int,input().split()))
    B = list(set(A))
    ans = 0
    for v in B:
        tmp = A.count(v)
        if tmp < v:
            ans += tmp
        else:
            ans += tmp-v
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
from collections import defaultdict
def main():
    N = int(input())
    d = defaultdict(int)
    ans = 0
    for a in tuple(map(int,input().split())):
        d[a] += 1
    for v in d.items():
        if v[0] > v[1]:
            ans += v[1]
        else:
            ans += v[1]-v[0]
    print(ans)
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from itertools import permutations
def main():
    N,M,R = map(int,stdin.readline().split())
    r = list(map(int,stdin.readline().split()))
    r = tuple(map(lambda x: x-1,r))
    dist = [[2**60]*N for _ in range(N)]
    for _ in range(M):
        A,B,C = map(int,stdin.readline().split())
        A -= 1
        B -= 1
        dist[A][B] = C
        dist[B][A] = C
    for i in range(N):
        dist[i][i] = 0
    for k in range(N):
        for i in range(N):
            for j in range(N):
                dist[i][j] = min(dist[i][j],dist[i][k]+dist[k][j])
    dist = tuple(map(lambda x: tuple(x),dist))
    ans = 2**60
    for t in tuple(permutations(r,R)):
        tmp = 0
        for i in range(R-1):
            tmp += dist[t[i]][t[i+1]] 
        ans = min(ans,tmp)
    
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
from sys import stdin
from itertools import permutations
def main():
    N,M,R = map(int,stdin.readline().split())
    r = list(map(int,stdin.readline().split()))
    r = tuple(map(lambda x: x-1,r))
    dist = [[2**60]*N for _ in range(N)]
    for _ in range(M):
        A,B,C = map(int,stdin.readline().split())
        A -= 1
        B -= 1
        dist[A][B] = C
        dist[B][A] = C
    for i in range(N):
        dist[i][i] = 0
    for k in range(N):
        for i in range(N):
            for j in range(N):
                dist[i][j] = min(dist[i][j],dist[i][k]+dist[k][j])
    dist = tuple(map(lambda x: tuple(x),dist))
    ans = 2**60
    for t in tuple(permutations(r,R)):
        tmp = 0
        for i in range(R-1):
            tmp += dist[t[i]][t[i+1]] 
        ans = min(ans,tmp)
    
    print(ans)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math
N ,K = map(int,input().split())
A = list(map(int, input().split()))
sum = [0] * N

for i in range(min(41,K)):
    for i in range(N):
        lo = max(0,i - A[i])
        up = min(N - 1,i+A[i])
        sum[lo] += 1
        if up + 1 < N:
            sum[up + 1] -= 1

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

    for i in range(N):
        A[i] = sum[i]
        sum[i] = 0

S = ""
for i in range(N):
    S += str(A[i])
    if i != N - 1 :
        S += " "

print(S)
    

Fixed submission:
S = input()
print(S[0] + S[1] + S[2])
Buggy python submission (verdict: Runtime Error):
print(eval(input()))

Fixed submission:
print(eval(str(input())))
Buggy python submission (verdict: Runtime Error):
import math

#ans^2 = A^2 +B^2 - 2ABconDiffを使用
line = input().split(" ")
A = int(line[0])
B = int(line[1])
H = int(line[2])
M = int(line[3])

ans = 0

#Aの刺す分
ang_a = H * 5 + M/12
#Bの刺す時間
ang_b = M

if ang_a == ang_b:
    ans = A - B

else:
    diff = abs(ang_a-ang_b)
    theta = (diff / 60) * 360
    ans_pow = A**2 + B**2 - 2 * A * B * math.cos(math.radians(theta))
    ans = ans_pow**0.5

print(ans_pow)
print(ans)



Fixed submission:
# coding: utf-8

import math

#ans^2 = A^2 +B^2 - 2ABconDiffを使用
line = input().split(" ")
A = int(line[0])
B = int(line[1])
H = int(line[2])
M = int(line[3])

ans = 0

#Aの刺す分
ang_a = H * 5 + M/12
#Bの刺す時間
ang_b = M

if ang_a == ang_b:
    ans = A - B

else:
    diff = abs(ang_a-ang_b)
    theta = (diff / 60) * 360
    ans_pow = A**2 + B**2 - 2 * A * B * math.cos(math.radians(theta))
    ans = ans_pow**0.5

print(ans)
Buggy python submission (verdict: Runtime Error):
S=input()

S_l=S.split('/')

if int(S_l[1]>4:
       print('TBD')
else:
       print('Heisei')

Fixed submission:
S=input()

S_l=S.split('/')

if int(S_l[1])>4:
       print('TBD')
else:
       print('Heisei')
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

N, M = map( int, input().split() )
X_list = np.array( sorted( list( map( int, input().split() ) ) ) )

diff=np.diff(X_list, n=1)

if N>=M:
	print(0)
	sys.exit()

for i in range(N-1):
	tmp_max=np.amax(diff)
	diff=diff[~(diff==tmp_max)]

cnt=np.sum(diff)

print(cnt)

Fixed submission:
import sys
import numpy as np

N, M = map( int, input().split() )
X_list = np.array( sorted( list( map( int, input().split() ) ) ) )

diff=np.diff(X_list, n=1)

if N>=M:
	print(0)
	sys.exit()

sorted_diff=np.sort(diff)

cnt=np.sum(sorted_diff[:M-N])

print(cnt)

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

N, M = map( int, input().split() )
X_list = sorted( list( map( int, input().split() ) ) )

List=[]
max_list=[]

if N>=M:
	print(0)
	sys.exit()


for i in range(len(X_list)):
	if i==len(X_list)-1:
		break
	tmp=abs(X_list[i]-X_list[i+1])
	List.append(tmp)
	if N==1:
		pass

	elif len(max_list)<N-1:
		max_list.append(tmp) 
	elif len(max_list)==N-1:
		if min(max_list)<tmp:
			max_list.append(tmp)
			max_list.remove(min(max_list))
		else:
			pass
	else:
		pass

cnt=sum(List)-sum(max_list)

print(cnt)


Fixed submission:
import sys
import numpy as np

N, M = map( int, input().split() )
X_list = np.array( sorted( list( map( int, input().split() ) ) ) )

diff=np.diff(X_list, n=1)

if N>=M:
	print(0)
	sys.exit()

sorted_diff=np.sort(diff)

cnt=np.sum(sorted_diff[:M-N])

print(cnt)

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

N, M = map( int, input().split() )
X_list = sorted( list( map( int, input().split() ) ) )

Dict={}

if N>=M:
	print(0)
	sys.exit()

for i in range(len(X_list)):
	if i==len(X_list)-1:
		break
	Dict[i]=abs(X_list[i]-X_list[i+1])

for n in range(N-1):
	tmp_max=max(Dict, key=Dict.get)
	del Dict[tmp_max]

cnt=0
for v in Dict.values():
	cnt+=v

print(cnt)

Fixed submission:
import sys
import numpy as np

N, M = map( int, input().split() )
X_list = np.array( sorted( list( map( int, input().split() ) ) ) )

diff=np.diff(X_list, n=1)

if N>=M:
	print(0)
	sys.exit()

sorted_diff=np.sort(diff)

cnt=np.sum(sorted_diff[:M-N])

print(cnt)
Buggy python submission (verdict: Runtime Error):
N, T=map(int, input().split())
 
c_list=[]
t_list=[]
ans_list=[]
for i in range(N):
  c,t=map(int, input().split())
  c_list.append(c)
  t_list.append(t)
 
ct_dict=dict(zip(c_list, t_list))  
  
if T<=min(t_list):
  print("TLE")
else:
  for k,v in ct_dict.items():
    if v<=T:
      ans_list.append(k)
 
print(min(ans_list))

Fixed submission:
N, T=map(int, input().split())
 
c_list=[]
t_list=[]
ans_list=[]
for i in range(N):
  c,t=map(int, input().split())
  c_list.append(c)
  t_list.append(t)
 
ct_dict=dict(zip(c_list, t_list))  
  
if T<=min(t_list):
  print("TLE")
else:
  for k,v in ct_dict.items():
    if v<=T:
      ans_list.append(k)
 
  print(min(ans_list))

Buggy python submission (verdict: Runtime Error):
N, T=map(int, input().split())

c_list=[]
t_list=[]
ans_list=[]
for i in N:
  c,t=map(int, input().split())
  c_list.append(c)
  t_list.append(t)

ct_dict=dict(zip(c_list, t_list))  
  
if T<=min(t_list):
  print("TLE")
else:
  for k,v in ct_dict.items():
    if v<=T:
      ans_list.append(k)

print(min(ans_list))

Fixed submission:
N, T=map(int, input().split())
 
c_list=[]
t_list=[]
ans_list=[]
for i in range(N):
  c,t=map(int, input().split())
  c_list.append(c)
  t_list.append(t)
 
ct_dict=dict(zip(c_list, t_list))  
  
if T<=min(t_list):
  print("TLE")
else:
  for k,v in ct_dict.items():
    if v<=T:
      ans_list.append(k)
 
  print(min(ans_list))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
s = 0
mod = 10**9+7
for i in range(len(a)-1):
    for j in range(i+1, len(a)):
        t = a[i]*a[j]
        t%=mod
        s += t
        s%=mod
print(s)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
k = 0
b = [0]*len(a)
ans = 0
for i in range(len(a)-1, 0, -1):
    k += a[i]
    k %= mod
    b[i] = k
for i in range(len(a)-1):
    ans += a[i] * b[i+1]
    ans %= mod

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
s = 0
mod = 10**9+7
for i in range(len(a)-1):
    for j in range(i+1, len(a)):
        t = a[i]*a[j]
        if t > mod:
            t%=mod
        s += t
        if s > mod:
            s%=mod
print(s)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
k = 0
b = [0]*len(a)
ans = 0
for i in range(len(a)-1, 0, -1):
    k += a[i]
    k %= mod
    b[i] = k
for i in range(len(a)-1):
    ans += a[i] * b[i+1]
    ans %= mod

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
s = 0
mod = 10**9+7
for i in range(len(a)-1):
    for j in range(i+1, len(a)):
        s += a[i]*a[j]
        if s > mod:
            s%=mod
print(s)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
k = 0
b = [0]*len(a)
ans = 0
for i in range(len(a)-1, 0, -1):
    k += a[i]
    k %= mod
    b[i] = k
for i in range(len(a)-1):
    ans += a[i] * b[i+1]
    ans %= mod

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
s = 0
mod = 10**9+7
for i in range(len(a)-1):
    for j in range(i+1, len(a)):
        s += a[i]*a[j]
        s%=mod
print(s)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
k = 0
b = [0]*len(a)
ans = 0
for i in range(len(a)-1, 0, -1):
    k += a[i]
    k %= mod
    b[i] = k
for i in range(len(a)-1):
    ans += a[i] * b[i+1]
    ans %= mod

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

H, W, M = map(int, input().split())
h_t = [0]*H
w_t = [0]*W
t = {}
for i in range(M):
    h, w = map(int, input().split())
    t[(h-1, w-1)] = 1
    h_t[h-1]+=1
    w_t[w-1]+=1
print(t)
h_max = max(h_t)
h_max_list = [i for i in range(len(h_t)) if h_t[i] == h_max]
w_max = max(w_t)
w_max_list = [i for i in range(len(w_t)) if w_t[i] == w_max]

for h in h_max_list:
    for w in w_max_list:
        if (h, w) not in t:
            print(h_max + w_max)
            exit()
print(h_max + w_max - 1)

Fixed submission:
N, X, T = map(int, input().split())
a = (N // X) * T
if N % X != 0:
    a += T
print(a)