Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    n,q = map(int,input().split())
    node = [[]for _ in range(n)]
    looked = [1]*n
    for i in range(n-1):
        a,b = map(int,input().split())
        node[b-1].append(a-1)
        node[a-1].append(b-1)
    counter = [0]*n
    for i in range(q):
        p,x = map(int,input().split())
        counter[p-1] += x
    queue = [0]
    looked[0] = 0
    while(queue):
        now = queue.pop(0)
        for i in node[now]:
            if looked[i]:
                queue.append(i)
                counter[i] += counter[now]
                looked[i] = 0
    print(*counter)
main()

Fixed submission:
a = int(input())
s = str(input())
if (a >= 3200):
    print(s)
else:
    print('red')
Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())
ans = int(2018)
for i in range(l,r):
    for j in range(l+1,r+1):
        if((i*j)%2019 < ans):
            ans = (i*j)%2019
print(ans)

Fixed submission:
import sys
l,r = map(int,input().split())
ans = int(2018)
if(r-l > 2020):
    print(0)
    sys.exit()
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            if((i*j)%2019 < ans):
                ans = (i*j)%2019
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())
ans = []
for i in range(l,r):
    for j in range(l+1,r+1):
        ans.append((i*j)%2019)
print(min(ans))

Fixed submission:
import sys
l,r = map(int,input().split())
ans = int(2018)
if(r-l > 2020):
    print(0)
    sys.exit()
else:
    for i in range(l,r):
        for j in range(l+1,r+1):
            if((i*j)%2019 < ans):
                ans = (i*j)%2019
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
z = list(map(int, input().split()))
a,b,c,d,cnt = z[0],z[1],z[2],z[3],0
while(a <= b):
    if (a%c != 0 and a%d != 0):
        cnt += 1
    a += 1
print(cnt)

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

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

a,b,c,d = map(int,input().split())
a -= 1
A = a-((a//c) + (a//d) - a//lcm(c,d))
B = b-((b//c) + (b//d) - b//lcm(c,d))
print(B-A)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
h, w = map(int, input().split())
a = [[] for _ in range(h)]
for i in range(h):
    a[i] = list(input())

dis = [[1000000 for _ in range(w)] for _ in range(h)]
queue = deque([])

for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            dis[i][j] = 0
            queue.append([i, j])

while queue:
    now = deque.popleft(queue)
    if now[0] != 0:
        if dis[now[0]-1][now[1]] == 1000000:
            dis[now[0]-1][now[1]] = dis[now[0]][now[1]]+1
            queue.append([now[0]-1, now[1]])
            
    if now[0] != h-1:
        if dis[now[0]+1][now[1]] == 1000000:
            dis[now[0]+1][now[1]] = dis[now[0]][now[1]]+1
            queue.append([now[0]+1, now[1]])
            
    if now[1] != 0:
        if dis[now[0]][now[1]-1] == 1000000:
            dis[now[0]][now[1]-1] = dis[now[0]][now[1]]+1
            queue.append([now[0], now[1]-1])
            
    if now[1] != w-1:
        if dis[now[0]][now[1]+1] == 1000000:
            dis[now[0]][now[1]+1] = dis[now[0]][now[1]]+1
            queue.append([now[0], now[1]+1])

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, dis[i][j])

print(ans)

Fixed submission:
from collections import deque
h, w = map(int, input().split())
a = [[] for _ in range(h)]
for i in range(h):
    a[i] = list(input())

dis = [[1000000 for _ in range(w)] for _ in range(h)]
queue = deque([])

for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            dis[i][j] = 0
            queue.append([i, j])

while queue:
    now = deque.popleft(queue)
    if now[0] != 0:
        if dis[now[0]-1][now[1]] == 1000000:
            dis[now[0]-1][now[1]] = dis[now[0]][now[1]]+1
            queue.append([now[0]-1, now[1]])
            
    if now[0] != h-1:
        if dis[now[0]+1][now[1]] == 1000000:
            dis[now[0]+1][now[1]] = dis[now[0]][now[1]]+1
            queue.append([now[0]+1, now[1]])
            
    if now[1] != 0:
        if dis[now[0]][now[1]-1] == 1000000:
            dis[now[0]][now[1]-1] = dis[now[0]][now[1]]+1
            queue.append([now[0], now[1]-1])
            
    if now[1] != w-1:
        if dis[now[0]][now[1]+1] == 1000000:
            dis[now[0]][now[1]+1] = dis[now[0]][now[1]]+1
            queue.append([now[0], now[1]+1])

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, dis[i][j])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
bit = 0b0

ans = 0
for i in range(2**n):
    bag = []
    cost = []
    for j in range(n):
        if(((bit >> j) & 1) == 1):
            bag.append(v[j])
            cost.append(c[j])
        else:
            bag.append(0)
            cost.append(0)
    p = sum(bag) - sum(cost)
    if(p > ans):
        ans = p
    bit += 1
print(ans)

Fixed submission:
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
bag = 0
for i in range(n):
    if(c[i] <= v[i]):
        bag += v[i] - c[i]
print(bag)
Buggy python submission (verdict: Runtime Error):
a = []
for i in range(5):
    a.append(int(input()))
b = []
for i in a:
    if i%10:
        b.append(i)
c = min(b,key = lambda x:x%10)
ans = 0
for i in a:
    if i%10:
        ans += i+(10-i%10)
    else:
        ans += i
print(ans-(10-c%10))

Fixed submission:
a = []
for i in range(5):
    a.append(int(input()))
b = []
for i in a:
    if i%10:
        b.append(i)
c = min(b,key = lambda x:x%10) if len(b) else 0
ans = 0
for i in a:
    if i%10:
        ans += i+(10-i%10)
    else:
        ans += i
print(ans-(10-c%10) if len(b) else ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
r = [0,0,0,0,0]
for i in range(0,5):
    r[i] = int(input())
place = [n,0,0,0,0,0]
time = 0
while(place[-1] != n):
    for i in range(5,0,-1):
        if(place[i-1] < r[i-1]):
            place[i] += place[i-1]
            place[i-1] = 0
        else:
            place[i] += r[i-1]
            place[i-1] -= r[i-1]
    time += 1
print(time)

Fixed submission:
import math
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(4+math.ceil(n/min(a,b,c,d,e)))
Buggy python submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
ans = 0
for i in range(m):
    current = 0
    a = list(map(int,input().split()))
    for k,j in enumerate(a):
        current += j*(k+1)
    ans += 1 if c+current else 0
print(ans)

Fixed submission:
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
ans = 0
for i in range(n):
    a = list(map(int,input().split()))
    ans += 1 if 0 < c+sum([a[j]*b[j] for j in range(m)]) else 0
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [100000000000 for _ in range(n)]
dp[0] = 0
for i in range(n):
    for j in range(min(i+1,k+1)):
        dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[-1])

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [100000000000 for _ in range(n)]
dp[0] = 0
for i in range(n):
    for j in range(min(i,k)+1):
        dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,W = map(int,input().split())
w = [0 for _ in range(N)]
v = [0 for _ in range(N)]

for i in range(N):
    w[i],v[i] = map(int,input().split())

dp = [[0 for i in range(W+1)]for j in range(N+1)]
for i in range(N):
    for j in range(W+1):
        if j+w[i] <= W:
            dp[i+1][j+w[i]] = max(dp[i][j], dp[i][j]+v[i])
            dp[i+1][j] = max(dp[i+1][j],dp[i][j])
        else:
            dp[i+1][j] = max(dp[i+1][j],dp[i][j])
print(dp[-1][-1])

Fixed submission:
N,W = map(int,input().split())
w = [0 for _ in range(N)]
v = [0 for _ in range(N)]

for i in range(N):
    w[i],v[i] = map(int,input().split())

dp = [[0 for i in range(W+1)]for j in range(N+1)]
for i in range(N):
    for j in range(W+1):
        if j+w[i] <= W:
            dp[i+1][j+w[i]] = max(dp[i][j], dp[i][j]+v[i])
            dp[i+1][j] = max(dp[i+1][j],dp[i][j])
        else:
            dp[i+1][j] = max(dp[i+1][j],dp[i][j])
print(dp[-1][-1])
Buggy python submission (verdict: Runtime Error):
import bisect
n,m = map(int,input().split())
data = []
for i in range(m):
    data.append(list(map(int,input().split())))
r = sorted(data,key= lambda x:(x[0],x[1]))
o = [[] for _ in range(100000)]

for i in range(m):
    o[r[i][0]].append(r[i][1])

for i in range(m):
    print("0"*(6-len(str(data[i][0]))),end="")
    print(data[i][0],end="")
    num = bisect.bisect_left(o[data[i][0]],data[i][1])+1
    print("0"*(6-len(str(num))),end="")
    print(num)

Fixed submission:
import bisect
n,m = map(int,input().split())
data = []
for i in range(m):
    data.append(list(map(int,input().split())))
r = sorted(data,key= lambda x:(x[0],x[1]))
o = [[] for _ in range(100001)]

for i in range(m):
    o[r[i][0]].append(r[i][1])

for i in range(m):
    print("0"*(6-len(str(data[i][0]))),end="")
    print(data[i][0],end="")
    num = bisect.bisect_left(o[data[i][0]],data[i][1])+1
    print("0"*(6-len(str(num))),end="")
    print(num)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = ["" for _ in range(n)]
for i in range(n):
    s[i] = str(input())
    s[i] = s[i][0]

march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]

for i in range(n):
    if s[i] in march:
        march_num[march.index(s[i])] += 1
ans = 0
for i in range(len(s)-2):
    for j in range(i+1,len(s)-1):
        for k in range(j+1,len(s)):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)

Fixed submission:
n = int(input())
s = ["" for _ in range(n)]
for i in range(n):
    s[i] = str(input())
    s[i] = s[i][0]

march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]

for i in range(len(s)):
    if s[i] in march:
        march_num[march.index(s[i])] += 1
ans = 0
for i in range(3):
    for j in range(i+1,4):
        for k in range(j+1,5):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = ["" for _ in range(n)]
for i in range(n):
    s[i] = str(input())
march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]
for i in range(n):
    if s[i][0] in march:
        march_num[march.index(s[i][0])] += 1
ans = 0
for i in range(len(s)-2):
    for j in range(i+1,len(s)-1):
        for k in range(j+1,len(s)):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)

Fixed submission:
n = int(input())
s = ["" for _ in range(n)]
for i in range(n):
    s[i] = str(input())
    s[i] = s[i][0]

march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]

for i in range(len(s)):
    if s[i] in march:
        march_num[march.index(s[i])] += 1
ans = 0
for i in range(3):
    for j in range(i+1,4):
        for k in range(j+1,5):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
    s.append(str(input()))
march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]
for i in range(n):
    if s[i][0] in march:
        march_num[march.index(s[i][0])] += 1
ans = 0
for i in range(len(s)-2):
    for j in range(i+1,len(s)-1):
        for k in range(j+1,len(s)):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)

Fixed submission:
n = int(input())
s = ["" for _ in range(n)]
for i in range(n):
    s[i] = str(input())
    s[i] = s[i][0]

march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]

for i in range(len(s)):
    if s[i] in march:
        march_num[march.index(s[i])] += 1
ans = 0
for i in range(3):
    for j in range(i+1,4):
        for k in range(j+1,5):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
b.sort()
c.sort()
ans = 0
for i in range(n):
    pos = 0
    for j in range(bisect.bisect_right(b,a[i]),n):
        while (pos < n and c[pos] <= b[j]):
            pos += 1
        ans += n-pos
print(ans)

Fixed submission:
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort()
c.sort()
ans = 0
for i in range(n):
    ans += bisect.bisect_left(a,b[i])*(n-bisect.bisect_right(c,b[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
b.sort()
c.sort()
ans = 0
for i in range(n):
    pos = 0
    for j in range(bisect.bisect_right(b,a[i]),n):
        while (pos < n and c[pos] <= b[j]):
            pos += 1
        ans += n-pos
print(ans)

Fixed submission:
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort()
c.sort()
ans = 0
for i in range(n):
    ans += bisect.bisect_left(a,b[i])*(n-bisect.bisect_right(c,b[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
b.sort()
c.sort()
ans = 0
for i in range(n):
    for j in range(bisect.bisect_right(b,a[i]),n):
        ans += n-bisect.bisect_right(c,b[j])
print(ans)

Fixed submission:
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort()
c.sort()
ans = 0
for i in range(n):
    ans += bisect.bisect_left(a,b[i])*(n-bisect.bisect_right(c,b[i]))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
b.sort()
c.sort()
ans = 0
for i in range(n):
    for j in range(bisect.bisect_right(b,a[i]),n):
        ans += n-bisect.bisect_right(c,b[j])
print(ans)

Fixed submission:
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort()
c.sort()
ans = 0
for i in range(n):
    ans += bisect.bisect_left(a,b[i])*(n-bisect.bisect_right(c,b[i]))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
paper = []
for i in range(n):
    a = int(input())
    if a in paper:
        paper.remove(a)
    else:
        paper.append(a)
print(len(paper))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
d = [1]
for i in range(n-1):
    if a[i] != a[i+1]:
        d.append(1)
    else:
        d[-1] += 1
ans = 0
for i in d:
    ans += i%2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
paper = []
for i in range(n):
    a = int(input())
    if a in paper:
        paper.remove(a)
    else:
        paper.append(a)
print(len(paper))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
d = [1]
for i in range(n-1):
    if a[i] != a[i+1]:
        d.append(1)
    else:
        d[-1] += 1
ans = 0
for i in d:
    ans += i%2
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())

t = max(a)
b = [0]*(t+1)

for i in range(n):
    if(b[a[i]] == 0):
        b[a[i]] = 1
    else:
        b[a[i]] = 0

print(sum(b))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
d = [1]
for i in range(n-1):
    if a[i] != a[i+1]:
        d.append(1)
    else:
        d[-1] += 1
ans = 0
for i in d:
    ans += i%2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [0 for _ in range(m)]
b = [0 for _ in range(m)]

for i in range(m):
    a[i],b[i] = map(int,input().split())

go = []

for i in range(len(a)):
    if (a[i] == 1):
        go.append(b[i])
        a[i],b[i] == 0,0
u = 0
t = len(a)
while(u < t):
    if a[u] == 0:
        del(a[u])
        del(b[u])
        t -= 1
    if b[u] != n:
        del(a[u])
        del(b[u])
        t -= 1
    u += 1

for i in range(len(go)):
    for j in range(len(a)):
        if(go[i] == a[j]):
            if(b[j] == n):
                print("POSSIBLE")
                exit()

print("IMPOSSIBLE")

Fixed submission:
n,m = map(int,input().split())
a = [0 for _ in range(m)]
b = [0 for _ in range(m)]

for i in range(m):
    a[i],b[i] = map(int,input().split())

go = []
goal = []

for i in range(len(a)):
    if a[i] == 1:
        go.append(b[i])
    if b[i] == n:
        goal.append(a[i])

count = [0 for i in range(n)]
for i in range(len(go)):
    count[go[i]-1] = 1
for i in range(len(goal)):
    count[goal[i]-1] += 1
for i in range(len(count)):
    if count[i] > 1:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [0 for _ in range(m)]
b = [0 for _ in range(m)]

for i in range(m):
    a[i],b[i] = map(int,input().split())

go = []

for i in range(len(a)):
    if (a[i] == 1):
        go.append(b[i])

for i in range(len(go)):
    for j in range(len(a)):
        if(go[i] == a[j]):
            if(b[j] == n):
                print("POSSIBLE")
                exit()

print("IMPOSSIBLE")

Fixed submission:
n,m = map(int,input().split())
a = [0 for _ in range(m)]
b = [0 for _ in range(m)]

for i in range(m):
    a[i],b[i] = map(int,input().split())

go = []
goal = []

for i in range(len(a)):
    if a[i] == 1:
        go.append(b[i])
    if b[i] == n:
        goal.append(a[i])

count = [0 for i in range(n)]
for i in range(len(go)):
    count[go[i]-1] = 1
for i in range(len(goal)):
    count[goal[i]-1] += 1
for i in range(len(count)):
    if count[i] > 1:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = [0]
if (n == 2):
    printf(abs(a[0] - a[1]))
else:
    for i in range(n):
        s.append(a[i] + s[i])

    b = 1e+9

    for j in range(n+1):
        if (abs(s[j] - (s[n] - s[j])) < b):
            b = abs(s[j] - (s[n] - s[j]))
    print(b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s = [0]
if (n == 2):
    print(abs(a[0] - a[1]))
else:
    for i in range(n):
        s.append(a[i] + s[i])

    b = 1e+9
    j = 1
    
    while(j < n):
        if (abs(s[j] - (s[n] - s[j])) < b):
            b = abs(s[j] - (s[n] - s[j]))
        j += 1
    print(b)
Buggy python submission (verdict: Runtime Error):
o = str(input())
e = str(input())
ans = []
for i in range(len(o)):
    ans.append(o[i])
    ans.append(e[i])
print(ans)

Fixed submission:
O = str(input())
E = str(input())
ans = []
for i in range(len(E)):
    ans.append(O[i])
    ans.append(E[i])
if(len(O) != len(E)):
    ans.append(O[-1])
print("".join(ans))

Buggy python submission (verdict: Runtime Error):
o = str(input())
e = str(input())
ans = []
for i in range(len(o)):
    ans.append(o[i])
    ans.append(e[i])
print("".join(ans))

Fixed submission:
O = str(input())
E = str(input())
ans = []
for i in range(len(E)):
    ans.append(O[i])
    ans.append(E[i])
if(len(O) != len(E)):
    ans.append(O[-1])
print("".join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
now = len(s)
while 1:
    if 7 <= now:
        if s[now-7:now] == "dreamer":
            now -= 7
    if 6 <= now:
        if s[now-6:now] == "eraser":
            now -= 6
    if 5 <= now:    
        if s[now-5:now] == "erase":
            now -= 5
        if s[now-5:now] == "dream":
            now -= 5
    if now == 0:
        print("YES")
        exit()
    elif now < 5:
        print("NO")
        exit()

Fixed submission:
s = input()
now = len(s)
while 1:
    flag = 1
    if 7 <= now:
        if s[now-7:now] == "dreamer":
            now -= 7
            flag = 0
    if 6 <= now:
        if s[now-6:now] == "eraser":
            now -= 6
            flag = 0
    if 5 <= now:    
        if s[now-5:now] == "erase":
            now -= 5
            flag = 0
        if s[now-5:now] == "dream":
            now -= 5
            flag = 0
    if flag:
        print("NO")
        exit()
    if now == 0:
        print("YES")
        exit()
    elif now < 5:
        print("NO")
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
def likes(i,j,ai,aj):
    if(i == aj and j == ai):
        return True
    else:
        return False

n = int(input())
a = list(map(int,input().split()))
count = 0
for i in range(n-1):
    for j in range(i+1,n):
        if(likes(i+1,j+1,a[i],a[j])):
            count += 1
print(count)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
count = 0
for i in range(n):
    if(a[a[i]-1] == i+1):
        count += 1
print(int(count/2))
Buggy python submission (verdict: Runtime Error):
a,c=map(int,input().split())
b,d=map(int,input().split())
t=map(int,input().split())
if c<=d:
  print('NO')
elif abs(a-b)<=(c-d)*t:
  print('YES')
else:
  print('NO')

Fixed submission:
a,c=map(int,input().split())
b,d=map(int,input().split())
t=int(input())
if c<=d:
  print('NO')
else:
  if abs(a-b)<=(c-d)*t:
  	print('YES')
  else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
N, X, T = map(int, raw_input().split())

for i in range(1001):
    if i * X >= N:
        print (i * T)
        break


Fixed submission:
N, X, T = map(int, input().split())

for i in range(1001):
    if i * X >= N:
        print (i * T)
        break
Buggy python submission (verdict: Runtime Error):
S = input()

a=RSS
b=RRS
c=RRR
d=SSS

if a in S:
   print(1)

elif b in S:
    print(2)
    
elif c = S:
    print(3)
    
elif d = S:
    print(0)

else:
    print(1)

Fixed submission:
S = input()

a = "RRR"
b = "RR"
c = "R"
    
if a == S:
    print(3)
    
elif b in S:
    print(2)

elif c in S:
    print(1)
    
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
ans = 0

if (a==s,b==s,c==s):
    print(ans)

elif (a==r,b==s,c==s):
    ans = 1 + ans
    print(ans)

elif (a==r,b==r,c==s):
    ans = 2 + ans
    print(ans)

else:
    ans = 1 + ans
    print(ans)

Fixed submission:
S = input()

a = "RRR"
b = "RR"
c = "R"
    
if a == S:
    print(3)
    
elif b in S:
    print(2)

elif c in S:
    print(1)
    
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())

for i in range(n):
  t,x,y = map(int,input().split())
  if (x + y) > t or (x + y + t) % 2:
    print("No")
    exit()
  print("Yes")

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


A = a*b % 2

if A==0:
    print("Even")

else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
impport sys

n = int(input())

for i in range(n):
  t,x,y = map(int,input().split())
  if (x + y) > t or (x + y + t) % 2:
    print("No")
    sys.exit()
  print("Yes")

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


A = a*b % 2

if A==0:
    print("Even")

else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
n = int(input())

for i in range(n):
    t,x,y = map(int,input().split())
    if (x + y) > t or (x + y + t) % 2:
        print("No")
        exit()
    print("Yes")


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


A = a*b % 2

if A==0:
    print("Even")

else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
  t,x,y = map(int,input().split())
  if (x + y) > t :
    print("No")
    exit()
print("Yes")

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


A = a*b % 2

if A==0:
    print("Even")

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

print(a+b+c)


Fixed submission:
D = input()

A="1"
B="11"
C="101"
F="111"

if F == D:
    print(3)
    
elif B in D:
    print(2)

elif C == D:
    print(2)

elif A in D:
    print(1)

else:
    print(0)