Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    H, W, M = map(int, input().split())
    bomb = [list(map(int, input().split()))for i in range(M)]
    H_bomb = [0] * (H + 1)
    W_bomb = [0] * (W + 1)
    for b in bomb:
        H_bomb[b[0]] += 1
        W_bomb[b[1]] += 1
    ans = max(H_bomb) + max(W_bomb)
    H_bomb_index = [i for i, v in enumerate(H_bomb) if v == max(H_bomb)]
    W_bomb_index = [i for i, v in enumerate(W_bomb) if v == max(W_bomb)]
    x_point = []
    for h in H_bomb_index:
        for w in W_bomb_index:
            x_point.append([h, w])
    flag = True
    for x in x_point:
        if x not in bomb:
            flag = False
    if flag:
        ans -= 1
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    H, W, M = map(int, input().split())
    bomb = [list(map(int, input().split()))for i in range(M)]
    H_bomb = [0] * (H + 1)
    W_bomb = [0] * (W + 1)
    for b in bomb:
        H_bomb[b[0]] += 1
        W_bomb[b[1]] += 1
    max_h, max_w = max(H_bomb), max(W_bomb)
    cnt = H_bomb.count(max_h) * W_bomb.count(max_w)
    for b in bomb:
        if H_bomb[b[0]] == max_h and W_bomb[b[1]] == max_w:
            cnt -= 1
    print(max_h + max_w + bool(cnt) - 1)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    K = int(input())
    if K % 7 == 0:
        L = 9 * K / 7
    else:
        L = 9 * K
    if L == 2 or L == 5:
        ans = -1
    else:
        i = 1
        tmp = 10
        while True:
            tmp %= L
            if tmp == 1:
                ans = i
                break
            i += 1
            tmp *= 10

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    K = int(input())
    if K % 7 == 0:
        L = 9 * K / 7
    else:
        L = 9 * K
    if L % 2 == 0 or L % 5 == 0:
        ans = -1
    else:
        i = 1
        tmp = 10
        while True:
            tmp %= L
            if tmp == 1:
                ans = i
                break
            i += 1
            tmp *= 10

    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    K = int(input())
    if K % 7 == 0:
        L = 9 * K / 7
    else:
        L = 9 * K
    if K == 2 or K == 5:
        ans = -1
    else:
        i = 1
        tmp = 10
        while True:
            tmp %= L
            if tmp == 1:
                ans = i
                break
            i += 1
            tmp *= 10

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    K = int(input())
    if K % 7 == 0:
        L = 9 * K / 7
    else:
        L = 9 * K
    if L % 2 == 0 or L % 5 == 0:
        ans = -1
    else:
        i = 1
        tmp = 10
        while True:
            tmp %= L
            if tmp == 1:
                ans = i
                break
            i += 1
            tmp *= 10

    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    K = int(input())
    if K == 2 or K == 5:
        ans = -1
    else:
        if K % 7 == 0:
            L = 9 * K / 7
        else:
            L = 9 * K
        i = 1
        tmp = 10
        while True:
            tmp %= L
            if tmp == 1:
                ans = i
                break
            i += 1
            tmp *= 10

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    K = int(input())
    if K % 7 == 0:
        L = 9 * K / 7
    else:
        L = 9 * K
    if L % 2 == 0 or L % 5 == 0:
        ans = -1
    else:
        i = 1
        tmp = 10
        while True:
            tmp %= L
            if tmp == 1:
                ans = i
                break
            i += 1
            tmp *= 10

    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    def make_divisors(n):
        lower_divisors, upper_divisors = [], []
        i = 1
        while i * i <= n:
            if n % i == 0:
                lower_divisors.append(i)
                if i != n // i:
                    upper_divisors.append(n // i)
            i += 1
        return lower_divisors + upper_divisors[::-1]

    N = int(input())
    print(sum([i * len(make_divisors(i)) for i in range(N + 1)]))


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

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

    def fanc(N):
        return N * (N + 1) // 2
    ans = 0
    for i in range(1, N + 1):
        ans += i * fanc(N // i)
    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

def main():
    import sympy
    N = int(input())
    print(sum([i * sympy.divisor_count(i) for i in range(N + 1)]))


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

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

    def fanc(N):
        return N * (N + 1) // 2
    ans = 0
    for i in range(1, N + 1):
        ans += i * fanc(N // i)
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from collections import Counter

    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())

    ans = [None] * Q
    A_Counter = Counter(A)
    for q in range(Q):
        B, C = map(int, input().split())
        A_Counter[C] += A_Counter[B]
        A_Counter[B] = 0

        ans[q] = sum(A_Counter.elements())

    print('\n'.join(map(str, ans)))


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    from collections import Counter

    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())

    ans = [None] * Q
    Asum = sum(A)
    A_Counter = Counter(A)
    for q in range(Q):
        B, C = map(int, input().split())
        Asum = Asum + (C-B)*A_Counter[B]
        A_Counter[C] += A_Counter[B]
        A_Counter[B] = 0

        ans[q] = Asum

    print('\n'.join(map(str, ans)))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    from collections import Counter

    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())

    A_Counter = Counter(A)
    for i in range(Q):
        B, C = map(int, input().split())
        A_Counter[C] += A_Counter[B]
        A_Counter[B] = 0

        print(sum(A_Counter.elements()))


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    from collections import Counter

    N = int(input())
    A = list(map(int, input().split()))
    Q = int(input())

    ans = [None] * Q
    Asum = sum(A)
    A_Counter = Counter(A)
    for q in range(Q):
        B, C = map(int, input().split())
        Asum = Asum + (C-B)*A_Counter[B]
        A_Counter[C] += A_Counter[B]
        A_Counter[B] = 0

        ans[q] = Asum

    print('\n'.join(map(str, ans)))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    if A[0]==A[1]:
        ans=0
    else:
        ans = 1
    
    for i in range(1,N):
        for j in range(i):
            if A[i]%A[j]==0:
                break
        else:
            ans+=1
    print(ans)
    
if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    Amax=A[-1]+1
    dp = [True]*Amax
    ans=0
    a_temp=set()
    a_tempcheck=set()
    for a in A:
        if dp[a]:
            ans+=1
            a_temp.add(a)
            for i in range(a, Amax, a):
                dp[i] = False
        else:
            if a not in a_tempcheck:
                if a in a_temp:
                    ans-=1
                    a_tempcheck.add(a)
    print(ans)
    
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
def resolve():
    li = input().split()
    A = int(li[0])
    B = int(li[1].replace('.',''))
    ans = int(A*B/100)
    print(ans)
resolve()

Fixed submission:
def resolve():
    N = int(input())
    def factorization(n):
        arr = []
        temp = n
        for i in range(2, int(-(-n**0.5//1))+1):
            if temp%i==0:
                cnt=0
                while temp%i==0:
                    cnt+=1
                    temp //= i
                arr.append([i, cnt])
        if temp!=1:
            arr.append([temp, 1])
        if arr==[]:
            arr.append([n, 1])
        return arr

    arr = factorization(N)
    ans = 0
    
    for i in range(len(arr)):
        for j in range(1,100):
            if arr[i][0] == 1:
                break
            elif arr[i][1] == 1:
                ans += 1
                break
            elif arr[i][1] == sum(range(0,j+1)):
                ans += j
                break
            elif arr[i][1] < sum(range(0,j+1)):
                ans += j-1
                break
    
    print(ans)
resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    print(-1)
resolve()

Fixed submission:
def resolve():
    H1, M1, H2, M2, K = map(int, input().split())
    import datetime
    AwakeTime = (H2*60 + M2)-(H1*60 + M1)
    ans = AwakeTime -K
    print(ans)
resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
	S, T = input().split()
	if T[:-1] == S:
		print('Yes')
	else:
		print('No')
resolve()

Fixed submission:
S = input()
T = input()
if T[:-1] == S:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
S, T = input().split()
if T[:-1] == S:
  print('Yes')
else:
  print('No')

Fixed submission:
S = input()
T = input()
if T[:-1] == S:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
S, T = input().split()
if T[:-1] == S:
  print('Yes')
else:
  print('No')

Fixed submission:
S = input()
T = input()
if T[:-1] == S:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
import collections


def main():
    X = int(input())
    A, B = 0, 0
    for i in range(-120, 120):
        if A == 0 and B == 0:
            for j in range(-120, 120):
                if i ** 5 - j ** 5 = X:
                    A, B = i, j
                    break
        else:
            break

    print("{} {}".format(A, B))


if __name__ == "__main__":
    main()


Fixed submission:
import collections


def main():
    X = int(input())
    A, B = 0, 0
    for i in range(-120, 120):
        if A == 0 and B == 0:
            for j in range(-120, 120):
                if i ** 5 - j ** 5 == X:
                    A, B = i, j
                    break
        else:
            break

    print("{} {}".format(A, B))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
if A == B:
	if K//A == 0:
        print('OK')
	else:
        print('NG')
else:
	if K//A == K//B:
		print('NG')
	else:
		print('OK')


Fixed submission:
K = int(input())
A,B = map(int,input().split())

for i in range(1000):
  if K*i >= A and K*i <= B:
    print('OK')
    break
else:
  print('NG')

Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
if A == B:
	if K//A == 0:
        print('OK')
    else:
		if K//A == K//B:
			print('NG')
		else:
			print('OK')

Fixed submission:
K = int(input())
A,B = map(int,input().split())

for i in range(1000):
  if K*i >= A and K*i <= B:
    print('OK')
    break
else:
  print('NG')
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = ['']*N
    for i in range(N):
        ans[i] = str(A.count(i+1))
    print('\n'.join(ans))
resolve()

Fixed submission:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    import collections
    c = collections.Counter(A)
    for i in range(1,N+1):
        print(c[i])
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    for i in range(1,N+1):
        ans = A.count(i)
        print(ans)
resolve()

Fixed submission:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    import collections
    c = collections.Counter(A)
    for i in range(1,N+1):
        print(c[i])
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    for i in range(1,N+1):
        ans = A.count(i)
        print(ans)
resolve()

Fixed submission:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    import collections
    c = collections.Counter(A)
    for i in range(1,N+1):
        print(c[i])
resolve()
Buggy python submission (verdict: Runtime Error):
X,Y,Z = int(input().split())
print('{} {} {}'.format(Z,X,Y))

Fixed submission:
X,Y,Z = map(int, input().split())
print('{} {} {}'.format(Z,X,Y))
Buggy python submission (verdict: Runtime Error):
S,T=map(int,input().split())
A,B=map(int,input().split())
U=input()
if U==S:
  A=A-1
else:
  B=B-1
print('{} {}'.format(A,B))


Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  A=A-1
else:
  B=B-1
print('{} {}'.format(A,B))
Buggy python submission (verdict: Runtime Error):
def main():
    N, K, S = map(int, input().split())
    MaxN = 10 ** 9
    if S == MaxN:
        A = [1] * N
    else:
        A = [MaxN] * N
    S = (S + 1) // 2
    if K != 0:
        for i in range(K + 1):
            if i % 2 == 0:
                A[i] = S
            else:
                A[i] = S - 1
    print(" ".join(map(str, A)))


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N, K, S = map(int, input().split())
    MaxN = 10 ** 9
    if S == MaxN:
        A = [S] * K + [1] * (N - K)
    else:
        A = [S] * K + [S + 1] * (N - K)

    print(" ".join(map(str, A)))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    N, K, S = map(int, input().split())
    INF = 10 ** 10
    A = [INF] * N
    S = (S + 1) // 2
    for i in range(K + 1):
        if i % 2 == 0:
            A[i] = S
        else:
            A[i] = S - 1
    print(" ".join(map(str, A)))


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N, K, S = map(int, input().split())
    MaxN = 10 ** 9
    if S == MaxN:
        A = [S] * K + [1] * (N - K)
    else:
        A = [S] * K + [S + 1] * (N - K)

    print(" ".join(map(str, A)))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
K,X=int(input().split())
if K*500>=X:
  print('Yes')
else:
  print('No')

Fixed submission:
K,X=map(int,input().split())
if K*500>=X:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
def resolve():
    import math
    N = int(input())
    price = N/1.08
    reTaxprice = math.floor(math.floor(price)*1.08)
    if reTaxprice == N:
        print(ans)
    else:
        print(':(')
resolve()


Fixed submission:
def resolve():
    import math
    N = int(input())
    price = N/1.08
    reTaxprice1 = math.floor(math.floor(price)*1.08)
    reTaxprice2 = math.floor(math.ceil(price)*1.08)
    if reTaxprice1 == N:
        print(math.floor(price))
    elif reTaxprice2 == N:
        print(math.ceil(price))
    else:
        print(':(')
resolve()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    L = sorted(map(int, input().split()),reverse=True)
    ans = 0
    for a in range(N - 2):
        for b in range(a + 1, N - 1):
            if L[a] > 2*L[b]:
                break
            for c in range(b + 1, N):
                if L[a] < L[b] + L[c] and L[b] < L[c] + L[a]:
                    ans += 1
                else:
                    break

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3
import bisect


def main():
    N = int(input())
    L = sorted(map(int, input().split()))
    ans = 0
    for a in range(N - 2):
        for b in range(a + 1, N - 1):
            ans += bisect.bisect_right(L, L[a] + L[b] - 1) - b - 1

    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    L = sorted(map(int, input().split()),reverse=True)
    ans = 0
    for a in range(N - 2):
        for b in range(a + 1, N - 1):
            for c in range(b + 1, N):
                if L[a] < L[b] + L[c] and L[b] < L[c] + L[a]:
                    ans += 1
                else:
                    break

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3
import bisect


def main():
    N = int(input())
    L = sorted(map(int, input().split()))
    ans = 0
    for a in range(N - 2):
        for b in range(a + 1, N - 1):
            ans += bisect.bisect_right(L, L[a] + L[b] - 1) - b - 1

    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    L = sorted(map(int, input().split()))
    ans = 0
    for a in range(N - 2):
        for b in range(a + 1, N - 1):
            for c in range(b + 1, N):
                if L[a] < L[b] + L[c] and L[b] < L[c] + L[a] and L[c] < L[a] + L[b]:
                    ans += 1
                elif L[c] > L[a] + L[b]:
                    break

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3
import bisect


def main():
    N = int(input())
    L = sorted(map(int, input().split()))
    ans = 0
    for a in range(N - 2):
        for b in range(a + 1, N - 1):
            ans += bisect.bisect_right(L, L[a] + L[b] - 1) - b - 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()))
    ans=[0]*N
    for i in range(N):
        ans[i]=str(A.index(i+1)+1)
    print(' '.join(ans))
    
if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    N=int(input())
    A = list(map(int,input().split()))
    ans=[None]*N
    i=1
    for a in A:
        ans[a-1]=str(i)
        i+=1
    print(' '.join(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N=int(input())
    A = list(map(int, input().split()))
    ans=[0]*N
    for i in range(N):
        ans[i]=str(A.index(i+1)+1)
    print(' '.join(ans))
    
if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    N=int(input())
    A = list(map(int,input().split()))
    ans=[None]*N
    i=1
    for a in A:
        ans[a-1]=str(i)
        i+=1
    print(' '.join(ans))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N=int(input())
    A = list(map(int, input().split()))
    ans=[]
    for i in range(1,N+1):
        ans.append(str(A.index(i)+1))
    ans = ' '.join(ans)
    print(ans)
    
if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    N=int(input())
    A = list(map(int,input().split()))
    ans=[None]*N
    i=1
    for a in A:
        ans[a-1]=str(i)
        i+=1
    print(' '.join(ans))

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = sum((N-1)*N//2)
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 = sum(range(N))
print(ans)

Fixed submission:
N = int(input())
ans = (N-1)*N//2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    S = [sorted(input()) for i in range(N)]
    ans = 0
    for i in range(N):
        for j in range(i + 1, N):
            if S[i] == S[j]:
                ans += 1

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3
import collections
import math


def main():
    N = int(input())
    S = ["".join(sorted(input())) for i in range(N)]
    cnt = collections.Counter(S)
    ans = 0
    for v in cnt.values():
        if v != 1:
            ans += math.factorial(v) // (math.factorial(v - 2) * 2)

    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    l, r = map(int, input().split())
    ans = 2018
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            ans = min(ans, i * j % 2019)
            if ans == 0:
                break
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    l, r = map(int, input().split())
    ans = 2019
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            ans = min(ans, i * j % 2019)
            if ans == 0:
                break
        if ans == 0:
            break
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

def main():
    N = int(input())
    h = list(map(int, input().split()))

    h.append(INF)
    h.append(INF)
    
    INF = 1 << 60
    dp = [INF] * 100010

    dp[0] = 0

    for i in range(N):
        dp[i + 1] = min(dp[i + 1], dp[i] + abs(h[i] - h[i + 1]))
        dp[i + 2] = min(dp[i + 2], dp[i] + abs(h[i] - h[i + 2]))

    print(dp[N-1])


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = int(input())
    h = list(map(int, input().split()))
    INF = 10**30
    h_dp = [INF] * N
    h_dp[0] = 0
    for i in range(1, N):
        h_dp[i] = min(h_dp[i], h_dp[i - 1] + abs(h[i] - h[i - 1]))
        if i > 1:
            h_dp[i] = min(h_dp[i], h_dp[i - 2] + abs(h[i] - h[i - 2]))
    print(h_dp[N - 1])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))

    INF = 1 << 60
    dp = [INF] * 100010

    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] - h[i + j]))

    print(dp[N - 1])


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3

def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))

    INF = 1 << 60
    dp = [INF] * 100010

    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] - h[i + j]))

    print(dp[N - 1])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
print((int(input()) - 1) * (int(input()) - 1))

Fixed submission:
#!/usr/bin/env python3

def main():
    a, b = map(int, input().split())
    print((a - 1) * (b - 1))


if __name__ == "__main__":
    main()