Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#ABC061D
from collections import deque
N,M = map(int,input().split())

ABC = []
Adake = [[] for _ in range(M)]
Bdake = [[] for _ in range(M)]
for i in range(M):
    a,b,c = map(int, input().split())
    ABC.append((a-1,b-1,-c))
    Adake[a-1].append(b-1)
    Bdake[b-1].append(a-1)

def dfs(X,s):
    used = {s}
    search = deque([s])
    while search:
        ss = search.pop()
        for sss in X[ss]:
            if sss in used:
                continue
            used.add(sss)
            search.append(sss)
    return used

U = dfs(Adake,0) & dfs(Bdake,N-1)
ABC = [(a,b,c) for (a,b,c) in ABC if a in U and b in U]

INF = float('inf')
dist = [INF] * N
dist[0] = 0
for i in range(N):
    for a,b,c in ABC:
        if dist[b] > dist[a] + c:
            dist[b] = dist[a] + c
            if i==N-1 and b == N-1:
                print('inf')
                exit()
print(-dist[-1])

Fixed submission:
import sys
N,M = map(int, input().split())
abc = [[] for _ in range(N)]
for i in range(M):
    a,b,c = map(int, input().split())
    abc[a-1].append((b-1,c))
    
S = [-float("inf")]*N
S[0] = 0
T = [0]
m = 0
n = 0
j = False
while T:
    t = T.pop(0)
    m += 1
    for tb,tc in abc[t]:
        if S[tb] < S[t]+tc:
            S[tb] = S[t]+tc
            T.append(tb)
    if m > M+1:
        d = abc[tb]
        if N-1 in list(d[i][0] for i in range(len(d))):
            j = True
        n += 1
    if n > M:
        if j:
            print("inf")
            sys.exit()
        else:
            break

print(S[-1])
Buggy python submission (verdict: Runtime Error):
L, N = map(int, input().split())
lists = []
for i in range(N):
    lists.append(input())
print(''.join(sorted(lists)))

Fixed submission:
N, L = map(int, input().split())
lists = []
for i in range(N):
    lists.append(input())

lists.sort()
print(''.join(lists))

Buggy python submission (verdict: Runtime Error):
L,N = map(int, input().split())
list=[]
for i in range(N):
  list.append(input())

print(''.join(sorted(list))

Fixed submission:
N, L = map(int, input().split())
lists = []
for i in range(N):
    lists.append(input())

lists.sort()
print(''.join(lists))
Buggy python submission (verdict: Runtime Error):
n=input()
#lst=list(n)
#print(lst)
s=0
for i in lst:
    s+=int(i)
if s%9==0:
    print('Yes')
else:
    print('No')

Fixed submission:
n=input()
lst=list(n)
#print(lst)
s=0
for i in lst:
    s+=int(i)
if s%9==0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n=input()
#lst=list(n)
print(lst)
s=0
for i in lst:
    s+=int(i)
if s%9==0:
    print('Yes')
else:
    print('No')

Fixed submission:
n=input()
lst=list(n)
#print(lst)
s=0
for i in lst:
    s+=int(i)
if s%9==0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
if n%2==0:
    print(-1)
else:
    c=1
    k=7
    while 1:
        if k%n==0:
            break
        if c>n:
            c=-1
            break
        k=int(str(k)+'7')
        c+=1
        #print(k)
    print(c)

Fixed submission:
n=int(input())
if n%2==0:
    print(-1)
else:
    c=1
    k=7
    while 1:
        if k%n==0:
            break
        if c>n:
            c=-1
            break
        k=(k%n)*10+7
        c+=1
        #print(k)
    print(c)
Buggy python submission (verdict: Time Limit Exceeded):
mod=1000000007
n,k=map(int, input().split())
lst=list(map(int, input().split()))
lst=sorted(lst)
p=1
if lst[-1]==0 and k%2!=0:
    print(0)
elif lst[-1]<0 and k%2!=0:
    for i in range(n-1,n-k-1,-1):
        #print(p)
        p*=lst[i]
    #print(p)
    print(p%mod)
else:
    j=n-1
    if k%2!=0:
        p*=lst[j]
        k-=1
        j-=1
    k=k//2
    i=0
    for x in range(k):
        if lst[i]*lst[i+1]>lst[j]*lst[j-1]:
            p*=(lst[i]*lst[i+1])
            i+=2
        else:
            p*=(lst[j]*lst[j-1])
            j-=2
    #print(p)
    print(p%mod)

Fixed submission:
mod=1000000007
n,k=map(int, input().split())
lst=list(map(int, input().split()))
lst=sorted(lst)
p=1
if lst[-1]==0 and k%2!=0:
    print(0)
elif lst[-1]<0 and k%2!=0:
    for i in range(n-1,n-k-1,-1):
        #print(p)
        p=(p%mod*lst[i]%mod)%mod
    #print(p)
    print(p%mod)
else:
    j=n-1
    if k%2!=0:
        p*=lst[j]
        k-=1
        j-=1
    k=k//2
    i=0
    for x in range(k):
        if lst[i]*lst[i+1]>lst[j]*lst[j-1]:
            p=(p%mod*lst[i]%mod*lst[i+1]%mod)%mod
            i+=2
        else:
            p=(p%mod*lst[j]%mod*lst[j-1]%mod)%mod
            j-=2
    #print(p)
    print(p%mod)
Buggy python submission (verdict: Runtime Error):
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)

s=input()
if s[len(s)-1]!='s':
    s+='s'
else:
    s+='es'
print(s)
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)

s=input()
if s[len(s)-1]!='s':
    s+='s'
else:
    s+='es'
print(s)


Fixed submission:
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)

s=input()
if s[len(s)-1]!='s':
    s+='s'
else:
    s+='es'
print(s)
Buggy python submission (verdict: Runtime Error):
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)


for _ in range(int(input())):
    n = int(input())
    #a = list(map(int, input().split()))
    #= map(int, input().split())
    if n>=30:
        print('Yes')
    else:
        print('No')

Fixed submission:
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)


n = int(input())
#a = list(map(int, input().split()))
#= map(int, input().split())
if n>=30:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a = [int(c) for c in input().split()]
r = a[0]*a[1]
if a[0] == 1 or a[1] == 1:
    print(1)
else r % 2 == 0:
    print(int(r/2))
else:
    print(int(r/2+1))

Fixed submission:
a = [int(c) for c in input().split()]
r = a[0]*a[1]
if a[0] == 1 or a[1] == 1:
    print(1)
elif r % 2 == 0:
    print(int(r/2))
else:
    print(int(r/2+1))
Buggy python submission (verdict: Time Limit Exceeded):
H = int(input())
E = [H]
cnt = 0
while E[len(E)-1] != 0:
    if E[cnt]==1:
        E[cnt]=0
    else:
        E.append(int(E[cnt]/2))
        E.append(int(E[cnt]/2))
    cnt+=1
print(cnt)


Fixed submission:
import sys
import copy
import math
import itertools

H = int(input())
cnt = 0
for i in range(int(math.log2(H))+1):
    cnt+=2**i
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
S = [ c for c in input()]

#aiは、その数より左側の連続した<の数(Si-1から数える)か、その数より右側の連続した>の数(Siから数える)の大きい方
a = []
for i in range(len(S)+1):
    cnt = [0,0]
    j = i
    while j-1 >= 0:
        if S[j-1] == "<" and j >= 0:
            cnt[0] +=1
            j -= 1
        else:
            break
    
    j = i
    while j <= len(S)-1:
        if S[j] == ">" and j<= len(S)-1:
            cnt[1] +=1
            j += 1
        else:
            break
    if cnt[0] >= cnt[1]:
        a.append(cnt[0])
    else:
        a.append(cnt[1])
    
print(sum(a))



Fixed submission:
import sys
import copy
import math
import itertools
import numpy as np
S=input()
N = len(S)+1
a = [0]*N
b = [0]*N
for i in range(N-1):
    if S[i]=="<":
        a[i+1]=a[i]+1

for i in reversed(range(N-1)):
    if S[i]==">":
        b[i]=b[i+1]+1

for i in range(N):
    if a[i] < b[i]:
        a[i]=b[i]

print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
S = [ c for c in input()]

#aiは、その数より左側の連続した<の数(Si-1から数える)か、その数より右側の連続した>の数(Siから数える)の大きい方
a = []
for i in range(len(S)+1):
    cnt = [0,0]
    j = i
    while j-1 >= 0:
        if S[j-1] == "<" and j >= 0:
            cnt[0] +=1
            j -= 1
        else:
            break
    
    j = i
    while j <= len(S)-1:
        if S[j] == ">" and j<= len(S)-1:
            cnt[1] +=1
            j += 1
        else:
            break
    if cnt[0] >= cnt[1]:
        a.append(cnt[0])
    else:
        a.append(cnt[1])
    
print(sum(a))



Fixed submission:
import sys
import copy
import math
import itertools
import numpy as np
S=input()
N = len(S)+1
a = [0]*N
b = [0]*N
for i in range(N-1):
    if S[i]=="<":
        a[i+1]=a[i]+1

for i in reversed(range(N-1)):
    if S[i]==">":
        b[i]=b[i+1]+1

for i in range(N):
    if a[i] < b[i]:
        a[i]=b[i]

print(sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
import math
import itertools
import numpy as np
N = int(input())
print(sum(range(N)))

Fixed submission:
N = int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
import math
import itertools
import numpy as np
N = int(input())
A = [int(input()) for c in range(N)]

for i in range(N):
    max = 0
    for j in range(N):
        if j!=i:
            if max<A[j]:
                max = A[j]
    print(max)

Fixed submission:
import sys
import copy
import math
import itertools
import numpy as np
N = int(input())
A = [int(input()) for c in range(N)]
B = sorted(copy.deepcopy(A),reverse=True)

for i in range(N):
    if A[i] == B[0]:
        print(B[1])
    else:
        print(B[0])
Buggy python submission (verdict: Runtime Error):
import sys
import copy
import math
import itertools
import numpy as np
import re

R,G,B,N = [int(c) for c in input().split()]
cnt = 0
for r in range(N//R+1):
    for g in range((N-r*R)//G+1):
        if r*R+g*G <= N and (N-r*R-g*G)%B == 0:
            cnt += 1
print(cnt)

Fixed submission:
import sys
import copy
import math
import itertools
import numpy as np
import re

R,G,B,N = [int(c) for c in input().split()]
cnt = 0
for r in range(N//R+1):
    for g in range((N-r*R)//G+1):
        if r*R+g*G <= N and (N-r*R-g*G)%B == 0:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = [int(c) for c in input().split()]
cnt = 0
for r in range(N//R+1):
    for g in range((N-r*R)//G+1):
        for b in range((N-r*R-g*G)//B+1):
            if r*R+g*G+b*B == N:
                cnt+=1

print(cnt)

Fixed submission:
import sys
import copy
import math
import itertools
import numpy as np
import re

R,G,B,N = [int(c) for c in input().split()]
cnt = 0
for r in range(N//R+1):
    for g in range((N-r*R)//G+1):
        if r*R+g*G <= N and (N-r*R-g*G)%B == 0:
            cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = [int(c) for c in input().split()]
h = [int(c) for c in input().split()]

dp=[0]*N
for i in range(1,N):
    dp[i]=dp[i-1]+abs(h[i]-h[i-1])
    for j in range(1,K+1):
        if i-j>=0:
            dp[i]=min([dp[i],dp[i-j]+abs(h[i]-h[i-j])])
            
print(dp[N-1])


Fixed submission:
N,K = [int(c) for c in input().split()]
h = [int(c) for c in input().split()]

dp=[0]*N
for i in range(1,N):
    dp[i]=dp[i-1]+abs(h[i]-h[i-1])
    for j in range(1,K+1):
        if i-j>=0:
            dp[i]=min([dp[i],dp[i-j]+abs(h[i]-h[i-j])])
            
print(dp[N-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,W = [int(c) for c in input().split()]
wv = [[int(c) for c in input().split()] for d in range(N)]

dp = [[0]*(W+1) for c in range(N)]
#i番目の品物まで候補としたとき(使うかはわからない)、重さj以下のときの価値の総量がdp[i][j]
for i in range(N):
    for j in range(W+1):
        #重さj以下で、iを使うときと使わないときの大きい方
        if j-wv[i][0] >= 0:
            dp[i][j] = max([dp[i-1][j-wv[i][0]]+wv[i][1],dp[i-1][j]])
        else:
            dp[i][j] = dp[i-1][j]

print(dp[-1][-1])

Fixed submission:
N,W = [int(c) for c in input().split()]
wv = [[int(c) for c in input().split()] for d in range(N)]

dp = [[0]*(W+1) for c in range(N)]
#i番目の品物まで候補としたとき(使うかはわからない)、重さj以下のときの価値の総量がdp[i][j]
for i in range(N):
    for j in range(W+1):
        #重さj以下で、iを使うときと使わないときの大きい方
        if j-wv[i][0] >= 0:
            dp[i][j] = max([dp[i-1][j-wv[i][0]]+wv[i][1],dp[i-1][j]])
        else:
            dp[i][j] = dp[i-1][j]

print(dp[-1][-1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for c in range(N)]
ans = []

for i in A:
    if i in ans:
        ans.remove(i)
    else:
        ans.append(i)
print(len(ans))

Fixed submission:
N = int(input())
A = [int(input()) for c in range(N)]
A = sorted(A)

tmp = 1
cnt = 0
for i in range(N):    
    if i+1<N:
        if A[i] == A[i+1]:
            tmp += 1
        else:
            cnt += tmp%2
            tmp = 1
    else:
        cnt += tmp%2

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
import math
import itertools
#import numpy as np
import re

N = int(input())
A = [int(input()) for c in range(N)]
ans = []

for i in A:
    if i in ans:
        ans.remove(i)
    else:
        ans.append(i)
print(len(ans))

Fixed submission:
N = int(input())
A = [int(input()) for c in range(N)]
A = sorted(A)

tmp = 1
cnt = 0
for i in range(N):    
    if i+1<N:
        if A[i] == A[i+1]:
            tmp += 1
        else:
            cnt += tmp%2
            tmp = 1
    else:
        cnt += tmp%2

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
import math
import itertools
#import numpy as np
import re

N = int(input())
A = [int(input()) for c in range(N)]
ans = []

for i in A:
    if i in ans:
        ans.remove(i)
    else:
        ans.append(i)
print(len(ans))

Fixed submission:
N = int(input())
A = [int(input()) for c in range(N)]
A = sorted(A)

tmp = 1
cnt = 0
for i in range(N):    
    if i+1<N:
        if A[i] == A[i+1]:
            tmp += 1
        else:
            cnt += tmp%2
            tmp = 1
    else:
        cnt += tmp%2

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
import math
import itertools
#import numpy as np
import re

N = int(input())
A = [int(input()) for c in range(N)]
A_s = list(set(A))
cnt=0

for i in A_s:
    if A.count(i)%2 == 1:
        cnt+=1

print(cnt)

Fixed submission:
N = int(input())
A = [int(input()) for c in range(N)]
A = sorted(A)

tmp = 1
cnt = 0
for i in range(N):    
    if i+1<N:
        if A[i] == A[i+1]:
            tmp += 1
        else:
            cnt += tmp%2
            tmp = 1
    else:
        cnt += tmp%2

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy
import math
import itertools
#import numpy as np
import re

N = int(input())
A = [int(input()) for c in range(N)]
ans = []
cnt=0
for i in range(N):
    if ans.count(A[i])%2==0:
        cnt+=1
    else:
        cnt-=1
    ans.append(A[i])


print(cnt)

Fixed submission:
N = int(input())
A = [int(input()) for c in range(N)]
A = sorted(A)

tmp = 1
cnt = 0
for i in range(N):    
    if i+1<N:
        if A[i] == A[i+1]:
            tmp += 1
        else:
            cnt += tmp%2
            tmp = 1
    else:
        cnt += tmp%2

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(c) for c in input().split()]
#ループしてX候補を求める
ma = 0
tmp = 0
for i in range(N):
    tmp = a.count(a[i]-1)+a.count(a[i])+a.count(a[i]+1)
    if ma < tmp:
        ma = tmp
print(ma)

Fixed submission:
N = int(input())
a = sorted([int(c) for c in input().split()])
#2回の変わり目を記憶
c1,c2,c3 = [0,0,0]
ma = 1
for i in range(N):
    if i > 0:
        if a[i]==a[i-1]+1:
            c1 = c2 
            c2 = c3
            c3 = i
        elif a[i]!=a[i-1]:
            c1,c2,c3=[i,i,i]
    if ma < i - c1+1:
        ma = i - c1+1

print(ma)
Buggy python submission (verdict: Runtime Error):
N,M = [int(c) for c in input().split()]
ab = [list(map(int,input().split())) for c in range(N)]
cd = [list(map(int,input().split())) for c in range(M)]
for i in range(N):
    mi = 2*10**8+1
    for j in range(M):
        tmp = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if mi > tmp:
            mi = tmp
            ans = j+1
    print(ans)


Fixed submission:
N,M = [int(c) for c in input().split()]
ab = [list(map(int,input().split())) for c in range(N)]
cd = [list(map(int,input().split())) for c in range(M)]
for i in range(N):
    mi = 2*10**9
    for j in range(M):
        tmp = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if mi > tmp:
            mi = tmp
            ans = j+1
    print(ans)

Buggy python submission (verdict: Runtime Error):
N,M = [int(c) for c in input().split()]
ab = [list(map(int,input().split())) for c in range(N)]
cd = [list(map(int,input().split())) for c in range(M)]
for i in range(N):
    mi = 2*10**8
    for j in range(M):
        tmp = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if mi > tmp:
            mi = tmp
            ans = j+1
    print(ans)


Fixed submission:
N,M = [int(c) for c in input().split()]
ab = [list(map(int,input().split())) for c in range(N)]
cd = [list(map(int,input().split())) for c in range(M)]
for i in range(N):
    mi = 2*10**9
    for j in range(M):
        tmp = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
        if mi > tmp:
            mi = tmp
            ans = j+1
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
ct = 0
for i in range(N-1):
    for j in range(i+1, N):
        x = A[i] * A[j]
        ct += x
print((ct % mod))


Fixed submission:
# C　Sum of product of pairs
N = int(input())
A = list(map(int, input().split()))
t = sum(A)
x = t - A[0]
mod = 10 ** 9 + 7
ct = 0
for i in range(N-1):
    ct += A[i] * x
    x = x - A[i+1]

print((ct % mod))
int((ct % mod))

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


Fixed submission:
# C　Sum of product of pairs
N = int(input())
A = list(map(int, input().split()))
t = sum(A)
x = t - A[0]
mod = 10 ** 9 + 7
ct = 0
for i in range(N-1):
    ct += A[i] * x
    x = x - A[i+1]

print((ct % mod))
int((ct % mod))
Buggy python submission (verdict: Runtime Error):
# C
n = int(input())
A = list(map(int, input().split()))
b = sum(A)
for i in range(n-1):
    if A[i] <= A[(i+1)]:
        continue
    else:
        s = A[i] - A[(i+1)]
        s = s + A[(i+1)]
        A.pop(A[(i+1)])
        A.insert((i+1),s)

print(sum(A) - b)


Fixed submission:
# 自分の改造
n = int(input())
A = list(map(int, input().split()))
s = 0 
M = 0
for i in range(n-1):
    if A[i] <= A[(i+1)] and M <= A[(i+1)]:
        M = 0
        continue
    else:
        if M == 0:
            s += A[i] - A[(i+1)]
            M = A[(i+1)] + (A[i] - A[(i+1)])
        else:
            s += M - A[(i+1)]
print(s)
Buggy python submission (verdict: Runtime Error):
# ABC169
# C Multiplication 3
A, B = map(str, input().split())
A = int(A)
B = int(B[0]+B[2]+B[3])
x = A * B
x = x // 100
print(int(x))


Fixed submission:
A, B = map(int, input().split())
print(A * B)
Buggy python submission (verdict: Time Limit Exceeded):
# B Multiplication 2
N = int(input())
A = list(map(int, input().split()))
x = 1
for i in A:
    x = x * i

if x > 10 ** 18:
    print(-1)
else:
    print(x)

Fixed submission:
# ABC169
# B Multiplication 2
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
x = 1
for i in A:
    if A[-1] == 0:
        print(0)
        exit()
    else:
        x = x * i
        if x > 10 ** 18:
            print(-1)
            exit()
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
# B Multiplication 2
N = int(input())
A = list(map(int, input().split()))
x = 1
for i in A:
    x = x * i

if x > 10 ** 18:
    print(-1)
else:
    print(x)

Fixed submission:
# ABC169
# B Multiplication 2
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
x = 1
for i in A:
    if A[-1] == 0:
        print(0)
        exit()
    else:
        x = x * i
        if x > 10 ** 18:
            print(-1)
            exit()
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, K = map(int, input().split())
ct = 0
if B == 0:
    if C == 0:
        print(A)
        exit()

for i in range(K):
    if A > 0:
        ct += 1
        A -= 1
    else:
        if B > 0:
            B -= 1
        else:
            ct -= 1
print(ct)


Fixed submission:
A, B, C, K = map(int, input().split())
if (K - A) <= 0:
    print(K)
else:
    if (K - A - B) <= 0:
        print(A)
    else:
        c = (K - A - B)
        print(A - c)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
while True:
    if (c - b) <= 0:
        print("Yes")
        exit()
    else:
        c = c - d
        if a - d <= 0:
            print("No")
            exit()
        else:
            a = a - 

Fixed submission:
a, b, c, d = map(int, input().split())
while True:
    if (c - b) <= 0:
        print("Yes")
        exit()
    else:
        c = c - b
        if a - d <= 0:
            print("No")
            exit()
        else:
            a = a - d
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split)
a = list(map(int, input().split()))
ct = 0
for i in range(m):
    ct += a[i]

if n - ct >= 0:
    print(n - ct)
else:
    print(-1)


Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
ct = 0
for i in range(m):
    ct += a[i]

if n - ct >= 0:
    print(n - ct)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
# ABC159
# A The Number of Even Pairs
import math
n, m = map(int, input().split())
if n < 2:
    x = 0
else:
    x = math.factorial(n) // (math.factorial(n-2) * math.factorial(2))

if m < 0:
    y = 0
else:
    y = math.factorial(m) // (math.factorial(m-2) * math.factorial(2))

print(x+y)


Fixed submission:
# ABC159
# A The Number of Even Pairs
import math
n, m = map(int, input().split())
if n < 2:
    x = 0
else:
    x = math.factorial(n) // (math.factorial(n-2) * math.factorial(2))

if m < 2:
    y = 0
else:
    y = math.factorial(m) // (math.factorial(m-2) * math.factorial(2))

print(x+y)
Buggy python submission (verdict: Runtime Error):

# ABC154
#A Remaining balls
s, t = map(input().split())
a, b = map(int, input().split())
u = input()
if s == u:
    a = a - 1
else:
    b = b -1
print(a, b)


Fixed submission:
# ABC154
#A Remaining balls
s, t = map(str,input().split())
a, b = map(int, input().split())
u = input()
if s == u:
    a = a - 1
else:
    b = b -1
print(a, b)
Buggy python submission (verdict: Runtime Error):

# ABC153
# B Common Raccoon VS Monster
h, n = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
if a <= s:
    print("Yes")
else:
    print("No")


Fixed submission:
# ABC153
# B Common Raccoon VS Monster
h, n = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
if h <= s:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
r = int(input)
x = r ** 2
print(x)


Fixed submission:
r = int(input())
x = r ** 2
print(x)
Buggy python submission (verdict: Runtime Error):

a, b = map(int, input().split())
x = a + b
y = a - b
z = a * b
O = [x,y,z]
O = sorted(O,reverse=1)
print(O[0]

Fixed submission:

a, b = map(int, input().split())
x = a + b
y = a - b
z = a * b
O = [x,y,z]
O = sorted(O,reverse=1)
print(O[0])

Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
x = a + b
y = a - b
z = a * b
O = sorted(list(x, y, z),reverse=True)
print(O[0])


Fixed submission:

a, b = map(int, input().split())
x = a + b
y = a - b
z = a * b
O = [x,y,z]
O = sorted(O,reverse=1)
print(O[0])