Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
import heapq

def main():
    N, M = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    h = []
    for v in A:
        heapq.heappush(h, v)

    BC = []
    for _ in range(M):
        BC.append([int(x) for x in input().split()])

    for i in range(M):
        for _ in range(BC[i][0]):
            x = heapq.heappop(h)
            if BC[i][1] > x:
                heapq.heappush(h, BC[i][1])
            else:
                heapq.heappush(h, x)
                break

    print(sum(h))



if __name__ == '__main__':
    main()



Fixed submission:
import sys
input = sys.stdin.readline
import heapq
from operator import itemgetter

def main():
    N, M = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    h = []
    for v in A:
        heapq.heappush(h, v)

    BC = []
    for _ in range(M):
        BC.append([int(x) for x in input().split()])

    BC_sorted = sorted(BC, key=itemgetter(1), reverse=True)

    is_end = False
    for i in range(M):
        for _ in range(BC_sorted[i][0]):
            x = heapq.heappop(h)
            if BC_sorted[i][1] > x:
                heapq.heappush(h, BC_sorted[i][1])
            else:
                heapq.heappush(h, x)
                is_end = True
                break

        if is_end:
            break

    print(sum(h))



if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
import heapq

def main():
    N, M = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    h = []
    for v in A:
        heapq.heappush(h, v)

    BC = []
    for _ in range(M):
        BC.append([int(x) for x in input().split()])

    for i in range(M):
        for _ in range(BC[i][0]):
            x = heapq.heappop(h)
            if BC[i][1] > x:
                heapq.heappush(h, BC[i][1])
            else:
                heapq.heappush(h, x)
                break

    print(sum(h))



if __name__ == '__main__':
    main()



Fixed submission:
import sys
input = sys.stdin.readline
import heapq
from operator import itemgetter

def main():
    N, M = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    h = []
    for v in A:
        heapq.heappush(h, v)

    BC = []
    for _ in range(M):
        BC.append([int(x) for x in input().split()])

    BC_sorted = sorted(BC, key=itemgetter(1), reverse=True)

    is_end = False
    for i in range(M):
        for _ in range(BC_sorted[i][0]):
            x = heapq.heappop(h)
            if BC_sorted[i][1] > x:
                heapq.heappush(h, BC_sorted[i][1])
            else:
                heapq.heappush(h, x)
                is_end = True
                break

        if is_end:
            break

    print(sum(h))



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import bisect


def main():
    N, Q = [int(x) for x in input().split()]
    S = input().strip()

    ac = []
    for i, s in enumerate(S):
        if s == 'A' and S[i + 1] == 'C':
            ac.append(i)

    for _ in range(Q):
        x, y = [int(x) for x in input().split()]
        l = bisect.bisect_left(ac, x - 1)
        r = bisect.bisect_right(ac, y - 2)
        print(r - l)

    
    




if __name__ == '__main__':
    main()




Fixed submission:
import sys
input = sys.stdin.readline
import bisect


def main():
    N, Q = [int(x) for x in input().split()]
    S = input().strip()

    ac = []
    for i in range(len(S) - 1):
        if S[i] == 'A' and S[i + 1] == 'C':
            ac.append(i)

    for _ in range(Q):
        x, y = [int(x) for x in input().split()]
        l = bisect.bisect_left(ac, x - 1)
        r = bisect.bisect_right(ac, y - 2)
        print(r - l)

    
    




if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    H = [int(x) for x in input().split()]

    dp = [0] * (N + 1)
    dp[2] = abs(H[0] - H[1])



    for i in range(3, N + 1):
        mi = float("inf")
        for j in range(i - 1, i - K - 1, -1):
            if j == 0:
                break
            mi = min(mi, dp[j] + abs(H[j - 1] - H[i - 1]))
        dp[i] = mi

    print(dp[N])




if __name__ == '__main__':
    main()



Fixed submission:
import sys
input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    H = [int(x) for x in input().split()]

    dp = [0] * (N + 1)
    dp[2] = abs(H[0] - H[1])

    for i in range(3, N + 1):
        mi = float("inf")
        for j in range(i - 1, i - K - 1, -1):
            if j == 0:
                break
            mi = min(mi, dp[j] + abs(H[j - 1] - H[i - 1]))
        dp[i] = mi

    print(dp[N])




if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    H = [int(x) for x in input().split()]

    dp = [0] * (N + 1)
    dp[2] = abs(H[0] - H[1])

    for i in range(3, N + 1):
        mi = float("inf")
        for j in range(i - 1, i - K - 1, -1):
            if j == 0:
                break
            mi = min(mi, dp[j] + abs(H[j - 1] - H[i - 1]))
        dp[i] = mi

    print(dp[N])




if __name__ == '__main__':
    main()



Fixed submission:
import sys
input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    H = [int(x) for x in input().split()]

    dp = [0] * (N + 1)
    dp[2] = abs(H[0] - H[1])

    for i in range(3, N + 1):
        mi = float("inf")
        for j in range(i - 1, i - K - 1, -1):
            if j == 0:
                break
            mi = min(mi, dp[j] + abs(H[j - 1] - H[i - 1]))
        dp[i] = mi

    print(dp[N])




if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

    count = 0 
    for i in range(a + 1):
        for j in range(b + 1):
            for k in range(c + 1):
                if x == (i * 500 + j * 100 + k * 50):
                    count += 1
    
    print(count)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0 
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if x == (i * 500 + j * 100 + k * 50):
                count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    C = Counter(A)

    ans = 0
    if len(C) <= K:
        print(0)
        return
    else:
        for i in range(len(C) - K):
            ans += C.most_common()[-i - 1][1]

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    C = Counter(A)

    ans = 0
    if len(C) <= K:
        print(0)
        return
    else:
        mc = C.most_common()
        for i in range(len(C) - K):
            ans += mc[-i - 1][1]

    print(ans)


if __name__ == '__main__':
    main()

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

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    C = Counter(A)

    ans = 0
    if len(C) <= K:
        print(0)
        return
    else:
        for i in range(len(C) - K):
            ans += C.most_common()[-i - 1][1]

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    C = Counter(A)

    ans = 0
    if len(C) <= K:
        print(0)
        return
    else:
        mc = C.most_common()
        for i in range(len(C) - K):
            ans += mc[-i - 1][1]

    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    XY = [[int(x) for x in input().split()] for _ in range(N)]

    xset = set()
    yset = set()

    for x, y in XY:
        xset.add(x)
        yset.add(y)

    xlist = list(xset)
    ylist = list(yset)

    ans = float("inf")

    for a, b in itertools.combinations(range(len(xlist)), 2):
        maxx = max(xlist[a], xlist[b])
        minx = min(xlist[a], xlist[b])

        for c, d in itertools.combinations(range(len(ylist)), 2):
            maxy = max(ylist[c], ylist[d])
            miny = min(ylist[c], ylist[d])

            cnt = 0
            for x, y in XY:
                if minx <= x <= maxx and miny <= y <= maxy:
                    cnt += 1

            if cnt >= K:
                ans = min(ans, (maxx - minx) * (maxy - miny))

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys
import itertools

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    XY = [[int(x) for x in input().split()] for _ in range(N)]

    xset = set()
    yset = set()

    for x, y in XY:
        xset.add(x)
        yset.add(y)

    xlist = list(xset)
    ylist = list(yset)

    ans = float("inf")

    for a, b in itertools.combinations(range(len(xlist)), 2):
        maxx = max(xlist[a], xlist[b])
        minx = min(xlist[a], xlist[b])

        for c, d in itertools.combinations(range(len(ylist)), 2):
            maxy = max(ylist[c], ylist[d])
            miny = min(ylist[c], ylist[d])

            cnt = 0
            for x, y in XY:
                if minx <= x <= maxx and miny <= y <= maxy:
                    cnt += 1

            if cnt >= K:
                ans = min(ans, (maxx - minx) * (maxy - miny))

    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())

    for h in range(1, 3501):
        for n in range(1, 3501):
            if 4 * n * h - N * n - N * h == 0:
                continue
            q, r = divmod(N * n * h, 4 * n * h - N * n - N * h)
            if r == 0 and q > 0:
                print(h, n, q)
                return


if __name__ == '__main__':
    main()


Fixed submission:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())

    for h in range(1, 3501):
        for n in range(1, 3501):
            if 4 * n * h - N * n - N * h == 0:
                continue
            q, r = divmod(N * n * h, 4 * n * h - N * n - N * h)
            if r == 0 and q > 0:
                print(h, n, q)
                return


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, csgraph_from_dense
import itertools

input = sys.stdin.readline


def main():
    N, M, R = [int(x) for x in input().split()]
    r = [int(x) - 1 for x in input().split()]
    ABC = [[int(x) for x in input().split()] for _ in range(M)]

    EDGE = [[10 ** 9] * N for j in range(N)]

    for a, b, c in ABC:
        EDGE[a - 1][b - 1] = c
        EDGE[b - 1][a - 1] = c

    G = csgraph_from_dense(EDGE, null_value=10 ** 9)

    d = floyd_warshall(G)

    ans = float("inf")
    for a in itertools.permutations(r):
        tmp = 0
        c = a[0]
        for n in a:
            tmp += int(d[c][n])
            c = n
        ans = min(ans, tmp)

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, csgraph_from_dense
import itertools

input = sys.stdin.readline


def main():
    N, M, R = [int(x) for x in input().split()]
    r = [int(x) - 1 for x in input().split()]
    ABC = [[int(x) for x in input().split()] for _ in range(M)]

    EDGE = [[10 ** 9] * N for j in range(N)]

    for a, b, c in ABC:
        EDGE[a - 1][b - 1] = c
        EDGE[b - 1][a - 1] = c

    G = csgraph_from_dense(EDGE, null_value=10 ** 9)

    d = floyd_warshall(G)

    ans = float("inf")
    for a in itertools.permutations(r):
        tmp = 0
        c = a[0]
        for n in a:
            tmp += int(d[c][n])
            c = n
        ans = min(ans, tmp)

    print(ans)


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

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    A.sort()

    if N == 1:
        if A[0] == K:
            print("POSSIBLE")
        else:
            print("IMPOSSIBLE")
        return

    g = math.gcd(A[0], A[1])

    for a in A:
        g = math.gcd(g, a)

    for a in A:
        if a >= K:
            if (K - a) % g == 0:
                print("POSSIBLE")
                return
    else:
        print("IMPOSSIBLE")


if __name__ == '__main__':
    main()


Fixed submission:
import sys
import fractions

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]

    A.sort()

    if N == 1:
        if A[0] == K:
            print("POSSIBLE")
        else:
            print("IMPOSSIBLE")
        return

    g = fractions.gcd(A[0], A[1])

    for a in A:
        g = fractions.gcd(g, a)

    for a in A:
        if a >= K:
            if (K - a) % g == 0:
                print("POSSIBLE")
                return
    else:
        print("IMPOSSIBLE")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    TA = [[int(x) for x in input().split()] for _ in range(N)]

    now = TA[0]
    for t, a in TA[1:]:
        i = 1
        while now[0] > t * i or now[1] > a * i:
            i += 1
        now[0] = t * i
        now[1] = a * i

    print(now[0] + now[1])


if __name__ == '__main__':
    main()


Fixed submission:
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    TA = [[int(x) for x in input().split()] for _ in range(N)]

    now = TA[0]
    for t, a in TA[1:]:
        i = max(now[0] //t , now[1] // a)
        while now[0] > t * i or now[1] > a * i:
            i += 1
        now[0] = t * i
        now[1] = a * i

    print(now[0] + now[1])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    X = input().strip()
    while X.count("ST"):
        a = X.find("ST")
        X = X[:a] + X[a + 2:]

    print(len(X))


if __name__ == '__main__':
    main()


Fixed submission:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    X = input().strip()


    scount = 0
    ans = 0
    for s in X:
        if s == "S":
            scount += 1
        elif s == "T":
            if scount == 0:
                continue
            else:
                scount -= 1
                ans += 2

    print(len(X) - ans)



if __name__ == '__main__':
    main()

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

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    X = input().strip()
    while X.count("ST"):
        a = X.find("ST")
        X = X[:a] + X[a + 2:]

    print(len(X))


if __name__ == '__main__':
    main()


Fixed submission:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    X = input().strip()


    scount = 0
    ans = 0
    for s in X:
        if s == "S":
            scount += 1
        elif s == "T":
            if scount == 0:
                continue
            else:
                scount -= 1
                ans += 2

    print(len(X) - ans)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
input = sys.stdin.readline

def main():
    S = input().strip()

    a = [[] for _ in range(26)]

    for i, s in enumerate(S):
        a[ord(s) - ord('a')].append(i)

    ans = []
    f = False
    for i in range(26):
        for j in range(len(a[i])):
            for k in range(j + 1, len(a[i])):
                if (a[i][k] - a[i][j] + 1) < (k - j + 1) * 2:
                    ans.append(a[i][j])
                    ans.append(a[i][k])
                    f = True
                    break
            if f:
                break
        if f:
            break

    if f:
        print(ans[0] + 1, ans[1] + 1)
    else:
        print(-1, -1)







    

if __name__ == '__main__':
    main()




Fixed submission:
import sys
import collections
input = sys.stdin.readline

def main():
    S = input().strip()

    a = [[] for _ in range(26)]

    for i, s in enumerate(S):
        a[ord(s) - ord('a')].append(i)

    ans = []
    f = False
    for i in range(26):
        for j in range(len(a[i]) - 1):
            if (a[i][j + 1] - a[i][j] + 1) < 4:
                ans.append(a[i][j])
                ans.append(a[i][j + 1])
                f = True
                break
        if f:
            break

    if f:
        print(ans[0] + 1, ans[1] + 1)
    else:
        print(-1, -1)







    

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
input = sys.stdin.readline

def main():
    S = input().strip()

    a = [[] for _ in range(26)]

    for i, s in enumerate(S):
        a[ord(s) - ord('a')].append(i)

    ans = []
    f = False
    for i in range(26):
        for j in range(len(a[i])):
            for k in range(j + 1, len(a[i])):
                if (a[i][k] - a[i][j] + 1) < (k - j + 1) * 2:
                    ans.append(a[i][j])
                    ans.append(a[i][k])
                    f = True
                    break
            if f:
                break
        if f:
            break

    if f:
        print(ans[0] + 1, ans[1] + 1)
    else:
        print(-1, -1)







    

if __name__ == '__main__':
    main()




Fixed submission:
import sys
import collections
input = sys.stdin.readline

def main():
    S = input().strip()

    a = [[] for _ in range(26)]

    for i, s in enumerate(S):
        a[ord(s) - ord('a')].append(i)

    ans = []
    f = False
    for i in range(26):
        for j in range(len(a[i]) - 1):
            if (a[i][j + 1] - a[i][j] + 1) < 4:
                ans.append(a[i][j])
                ans.append(a[i][j + 1])
                f = True
                break
        if f:
            break

    if f:
        print(ans[0] + 1, ans[1] + 1)
    else:
        print(-1, -1)







    

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
H, N = map(int, input().split())
A = list(map(int, input().split()))
import itertools
a = list(itertools.combinations(A, 2))

if sum(max(a)) >= H:
    print('Yes')
else:
    print('No')


Fixed submission:
H, N = map(int, input().split())
A = list(map(int, input().split()))
if sum(A) >= H:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a, b = map(int.input().split())

answer = a * b

if answer % == 0:
    print('Even')
else:
    print('Odd')

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

answer = a * b

if answer % 2 == 0:
    print('Even')
else:
    print('Odd')

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

multi = a * b


if multi % 2 == 0:
    print('Even')
else:
    print('0dd')

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

answer = a * b

if answer % 2 == 0:
    print('Even')
else:
    print('Odd')
Buggy python submission (verdict: Runtime Error):
# 入力
A = int(input())
op = input()
B = int(input())

if op == '+':
    print(A + B)
elif op == '-':
    print(A - B)



Fixed submission:
# 入力
A, op, B = input().split()

A = int(A)
B = int(B)

# 出力
if op == '+':
    print(A + B)
elif op == '-':
    print(A - B)
Buggy python submission (verdict: Runtime Error):
k=int(input())
print(ACL*k)

Fixed submission:
k=int(input())
print("ACL"*k)
Buggy python submission (verdict: Runtime Error):
s=input()
if s[-1]==s:
	s1= s +"es"
  	print(s1)
else:
  	s2 = s +"s"
    	print(s2)

Fixed submission:
s3="s"
es="es"
S=input()
if S[-1]=="s":
	s1= S + es
	print(s1)
else:
	s2 = S + s3
	print(s2)

Buggy python submission (verdict: Runtime Error):
s=input()
if s[-1]==s:
	s1= s +"es"
  print(s1)
else:
  	s2 = s +"s"
    print(s2)

Fixed submission:
s3="s"
es="es"
S=input()
if S[-1]=="s":
	s1= S + es
	print(s1)
else:
	s2 = S + s3
	print(s2)
Buggy python submission (verdict: Runtime Error):
a, b, c= map(input().split())
num= int(input())
cot=0
for x in range(num):
    if a >= b and c >= a:
        b=b*2
    else:
        c=c*2
if b > a and c > b:
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c= map(int, input().split())
num= int(input())
for x in range(num):
    if a >= b and c >= a:
        b=b*2
    else:
        c=c*2
if b > a and c > b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(){
    int a, b, c, num, eq=0;
    scanf("%d %d %d", &a, &b, &c);
    scanf("%d", &num);
    for(int i=0; i<num; ++i){
    if(a>=b && c>=a)
        b=b*2;

    else
        c=c*2;
    }
    if(b>a && c >b)
        printf("YES");
    else    
        printf("NO");
    
    ///printf("%d %d %d\n", a, b, c);
    printf("\n");
    
    return 0;
}

Fixed submission:
n,k= map(int, input().split())
num= [int (x) for x in input().split()]
for i in range(n-k):
    if num[i] < num[k+i]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
k= int(input())
cont=0
a, b= input().split()
a= int(a)
b= int(b)
while 1:
    cont+= k
    if a<= cont <= b:
        print("OK")
        break
    if x > b:
        print("NG")
        break

Fixed submission:
k= int(input())
a, b= input().split()
a= int(a)
b= int(b)
cont=0
while 1:
    cont+= k
    if a<= cont <= b:
        print("OK")
        break
    if cont > b:
        print("NG")
        break
Buggy python submission (verdict: Runtime Error):
    n= int(input())
    lista=[]
    listanova=[]
    for x in input().split():
    	x= int(x)
    	if x %2 ==0:
    		lista.append(x)
    for x in lista:
    	if x %3==0 or x%5==0:
    		listanova.append(x)
     
    if len(lista)==len(listanova):
    	print('APPROVED')
    else:
    	print('DENIED')

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

if (a==b and c==b) or (a!=b and b!=c and c!=a):
	print('No')
else:
	print('Yes')
Buggy python submission (verdict: Runtime Error):
    n= int(input())
    lista=[]
    listanova=[]
    for x in input().split():
    	x= int(x)
    	if x %2 ==0:
    		lista.append(x)
    for x in lista:
    	if x %3==0 or x%5==0:
    		listanova.append(x)
     
    if len(lista)==len(listanova):
    	print('APPROVED')
    else:
    	print('DENIED')

Fixed submission:
n= int(input())
lista=[]
listanova=[]
for x in input().split():
	x= int(x)
	if x %2 ==0:
		lista.append(x)
for x in lista:
	if x %3==0 or x%5==0:
		listanova.append(x)

if len(lista)==len(listanova):
	print('APPROVED')
else:
	print('DENIED')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

ans = 0
for a in range(1, n):
    for b in range(1, n):
        if a * b < n:
            ans += 1
        else:
            break
print(ans)

Fixed submission:
n = int(input())

ans = 0
for a in range(1, n):
    ans += (n - 1) // a
print(ans)