Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(list(map(int,input().split())))
a.sort()
#print(a)
d=[]
for i in range(m):
    if a[i][0]==1:
        d.append(a[i][1])
    else:
        break
e=[]
for i in range(m):
    if a[i][1]==n:
        e.append(a[i][0])
if len(d)>=len(e):
    for i in range(len(e)):
        if e[i] in d:
            print('POSSIBLE')
            exit()
    print('IMPOSSIBLE')
else:
    for i in range(len(d)):
        if d[i] in e:
            print('POSSIBLE')
            exit()
    print('IMPOSSIBLE')
#print([d[0],n])

Fixed submission:
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(list(map(int,input().split())))
a.sort()
#print(a)
d=[]
for i in range(m):
    if a[i][0]==1:
        d.append(a[i][1])
    else:
        break
e=[]
for i in range(m):
    if a[i][1]==n:
        e.append(a[i][0])
if len(set(e) & set(d))!=0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(list(map(int,input().split())))
a.sort()
#print(a)
d=[]
for i in range(m):
    if a[i][0]==1:
        d.append(a[i][1])
    else:
        break
e=[]
for i in range(m):
    if a[i][1]==n:
        e.append(a[i])
for i in range(len(d)):
    if [d[i],n] in e:
        print('POSSIBLE')
        exit()
print('IMPOSSIBLE')
#print([d[0],n])

Fixed submission:
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(list(map(int,input().split())))
a.sort()
#print(a)
d=[]
for i in range(m):
    if a[i][0]==1:
        d.append(a[i][1])
    else:
        break
e=[]
for i in range(m):
    if a[i][1]==n:
        e.append(a[i][0])
if len(set(e) & set(d))!=0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(list(map(int,input().split())))
a.sort()
#print(a)
d=[]
for i in range(m):
    if a[i][0]==1:
        d.append(a[i][1])
    else:
        break
for i in range(len(d)):
    if [d[i],n] in a:
        print('POSSIBLE')
        exit()
print('IMPOSSIBLE')
#print([d[0],n])

Fixed submission:
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(list(map(int,input().split())))
a.sort()
#print(a)
d=[]
for i in range(m):
    if a[i][0]==1:
        d.append(a[i][1])
    else:
        break
e=[]
for i in range(m):
    if a[i][1]==n:
        e.append(a[i][0])
if len(set(e) & set(d))!=0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(10**9):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-1
    print(ans)

Fixed submission:
a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(2*10**5):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-1
    print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b and b==c:
    print(-1)
elif if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(200000):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-1
    print(ans)

Fixed submission:
a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
else:
    a1=0
    a2=0
    a3=0
    c1=0
    c2=0
    c3=0
    ans=0
    for i in range(2*10**5):
        if a%2!=0:
            c1=1        
        if b%2!=0:
            c2=1        
        if c%2!=0:
            c3=1
        if c1==1 or c3==1 or c2==1:
            ans=i
            break
        else:
            a3=(a+b)//2
            a2=(a+c)//2
            a1=(b+c)//2
            a=a1
            b=a2
            c=a3
        #print(a,b,c)
        if i==199999:
            ans=-1
    print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
a=list(a)
b=list(b)
c=list(c)
if a[len(a)]==b[0] and b[len(b)]==c[0]:
  print('YES')
else:
  print('NO')

Fixed submission:
a,b,c=input().split()
a=list(a)
b=list(b)
c=list(c)
if a[len(a)-1]==b[0] and b[len(b)-1]==c[0]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
a=list(a)
b=list(b)
c=list(c)
print(a[0].upper+b[0].upper+c[0].upper)

Fixed submission:
a,b,c=input().split()
a=list(a)
b=list(b)
c=list(c)
print(a[0].upper()+b[0].upper()+c[0].upper())
Buggy python submission (verdict: Runtime Error):
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
b=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>(len(list(str(n)))+1)//2:
        print(len(list(str(d[len(d)-1]))))
    else:
        for i in range(len(d)):
            if i%2==0:
                a*=d[i//2]
            else:
                a*=d[len(d)-i//2]
            if a>n**(1/2):
                break
        a=str(a)
        print(len(list(a)))
        #print(a)


Fixed submission:
n=int(input())
cnt=[]
for i in range(1,int(n**(1/2))+1000):
    if n%i==0:
        cnt.append(n//i)
        cnt.append(i)
#print(cnt)
ans=[]
for j in range(len(cnt)//2):
    a=list(str(cnt[2*j]))
    b=list(str(cnt[2*j+1]))
    ans.append(max(len(a),len(b)))
print(min(ans))

Buggy python submission (verdict: Runtime Error):
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>=(len(list(str(n)))+1)//2:
        print(len(list(str(d[len(d)-1]))))
    else:
        for i in range(d):
            a*=d[i]
            if a>n**(1/2):
                break
        a=str(a)
        print(len(list(a)))

Fixed submission:
n=int(input())
cnt=[]
for i in range(1,int(n**(1/2))+1000):
    if n%i==0:
        cnt.append(n//i)
        cnt.append(i)
#print(cnt)
ans=[]
for j in range(len(cnt)//2):
    a=list(str(cnt[2*j]))
    b=list(str(cnt[2*j+1]))
    ans.append(max(len(a),len(b)))
print(min(ans))

Buggy python submission (verdict: Runtime Error):
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
if len(list(str(d[len(d)-1])))>=len(list(str(n)))//2+1:
    print(len(list(str(d[len(d)-1]))))
else:
    print(len(list(str(n)))//2+1)

Fixed submission:
n=int(input())
cnt=[]
for i in range(1,int(n**(1/2))+1000):
    if n%i==0:
        cnt.append(n//i)
        cnt.append(i)
#print(cnt)
ans=[]
for j in range(len(cnt)//2):
    a=list(str(cnt[2*j]))
    b=list(str(cnt[2*j+1]))
    ans.append(max(len(a),len(b)))
print(min(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
for i in range(1,n+1):
  ans*=i
print(ans%(10**9+7))

Fixed submission:
n=int(input())
ans=1
for i in range(1,n+1):
  ans*=i
  if ans>10**9+7:
      ans=ans%(10**9+7)
print(ans%(10**9+7))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int.input().split()))
c=0
for i in range(n):
    if a[i]%2!=0:
        c+=1
if c%2==0:
    print('YES')
else:
    print('NO')

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
    if a[i]%2!=0:
        c+=1
if c%2==0:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
count=0
for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i+j+l==s:
                count+=1
print(count)

Fixed submission:
k,s=map(int,input().split())
count=0
for i in range(k+1):
    for j in range(k+1):
        if i+j<=s:
            if i+j+k>=s:
                count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
a=int(a)
b=int(b)
if b=='-':
  print(a-c)
else:
  print(a+b)

Fixed submission:
a,b,c=input().split()
a=int(a)
c=int(c)
if b=='-':
  print(a-c)
else:
  print(a+c)
Buggy python submission (verdict: Runtime Error):
s=list(input())
ans=0
for i in range(len(s)):
  if ans==2:
    break
  if s[i]=='C':
    ans+=1
  if ans=1:
    if s[i]=='F':
      ans+=1
if ans==2:
  print('Yes')
else:
  print('No')
  

Fixed submission:
s=list(input())
ans=0
for i in range(len(s)):
    if s[i]=='C':
        ans+=1
        break
for j in range(i,len(s)):
    if s[j]=='F':
        ans+=1
        break
if ans==2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
n,a,b=map(int,input().split())
s=list(input())
t=[]
count=1
for i in range(n):
    if s[i]=='a':
        if count<=a+b:
            count+=1
            print('Yes')
        else:
            print('No')
    elif s[i]=='b':
        t.append(s[i])
        if count<=a+b and t.count('b')<=b:
            count+=1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Fixed submission:
# coding: utf-8
# Your code here!
n,a,b=map(int,input().split())
s=list(input())
count=1
c=1
for i in range(n):
    if s[i]=='a':
        if count<=a+b:
            count+=1
            print('Yes')
        else:
            print('No')
    elif s[i]=='b':
        if count<=a+b and c<=b:
            count+=1
            c+=1
            print('Yes')
        else:
            print('No')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
sa=list(input())
sb=list(input())
sc=list(input())
cnt=sa[0]
sa.remove(sa[0])
while len(sa)!=0 or len(sb)!=0 or len(sc)!=0:
    #print(sa,sb,sc)
    if cnt=='a':
        cnt=sa[0]
        sa.remove(sa[0])
    elif cnt=='b':
        cnt=sb[0]
        sb.remove(sb[0])
    elif cnt=='c':
        cnt=sc[0]
        sc.remove(sc[0])
    if len(sa)==0 and cnt=='a':
        print("A")
        break
    elif len(sb)==0 and cnt=='b':
        print("B")
        break
    elif len(sc)==0 and cnt=='c':
        print("C")
        break


Fixed submission:
sa=list(input())
sb=list(input())
sc=list(input())
cnt=sa[0]
sa.remove(sa[0])
while len(sa)!=0 or len(sb)!=0 or len(sc)!=0:
    #print(sa,sb,sc)
    if cnt=='a':
        if sa!=[]:
            cnt=sa[0]
            sa.remove(sa[0])
    elif cnt=='b':
        if sb!=[]:
            cnt=sb[0]
            sb.remove(sb[0])
    elif cnt=='c':
        if sc!=[]:
            cnt=sc[0]
            sc.remove(sc[0])
    if len(sa)==0 and cnt=='a':
        print("A")
        break
    elif len(sb)==0 and cnt=='b':
        print("B")
        break
    elif len(sc)==0 and cnt=='c':
        print("C")
        break
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = str(input())
# 文字列の入力

# 出力
print chr(ord(a) + 1)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = str(input())
# 文字列の入力
 
# 出力
print(chr(ord(a) + 1))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = [1,2,3]
c.remove(a)
c.remove(b)

print(c[0])


Fixed submission:
c = [1,2,3]

a = int(input())
b = int(input())

c.remove(a)
c.remove(b)

print(c[0])

Buggy python submission (verdict: Runtime Error):
c = [1,2,3]

a　= int(input())
b　= int(input())

c.remove(a)
c.remove(b)

c[0]

Fixed submission:
c = [1,2,3]

a = int(input())
b = int(input())

c.remove(a)
c.remove(b)

print(c[0])

Buggy python submission (verdict: Runtime Error):
c = [1,2,3]

a, b = map(int, input().split())

c.remove(a)
c.remove(b)

c[0]

Fixed submission:
c = [1,2,3]

a = int(input())
b = int(input())

c.remove(a)
c.remove(b)

print(c[0])

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
 
if a!=3 && b!=3:
  c = 3
elif a!=2 && b!=2:
  c = 2
elif a!=1 && b!=1:
  c = 1
  
print("{}".format(c))

Fixed submission:
c = [1,2,3]

a = int(input())
b = int(input())

c.remove(a)
c.remove(b)

print(c[0])

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input())
b = int(input())

if a==1 && b==2:
  c = 3
elif a==2 && b==1:
  c = 3
elif a==1 && b==3:
  c = 2
elif a==3 && b==1:
  c = 2
else:
  c = 1
  
print("{}".format(c))

Fixed submission:
c = [1,2,3]

a = int(input())
b = int(input())

c.remove(a)
c.remove(b)

print(c[0])
Buggy python submission (verdict: Time Limit Exceeded):
import sys

N=int(input())
A=list(map(int, input().split()))
if 0 in A:
    print(0)
    sys.exit(0)
ans=1
for i in A:
    ans = ans*i
if ans <= 1000000000000000000:
    print(ans)
else:
    print(-1)

Fixed submission:
def cal():
    N=int(input())
    A=list(map(int, input().split()))
    if 0 in A:
        print(0)
        return
    ans=1
    for i in A:
        ans = i*ans
        if ans > 1000000000000000000:
            print(-1)
            return
    print(ans)

cal()

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
ans=1
for i in A:
    ans = ans*i
if ans <= 10 ** 18:
    print(ans)
else:
    print(-1)

Fixed submission:
def cal():
    N=int(input())
    A=list(map(int, input().split()))
    if 0 in A:
        print(0)
        return
    ans=1
    for i in A:
        ans = i*ans
        if ans > 1000000000000000000:
            print(-1)
            return
    print(ans)

cal()
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K=map(int, input().split(' '))
total = 0
for _ in range(K):
    if A > 0:
        total += 1
        A = A - 1
    elif B > 0:
        B = B - 1
    elif C > 0:
        total -= 1
        C = C -1
print(total)


Fixed submission:
A,B,C,K=map(int, input().split(' '))
ans = 0
if A >= K:
    print(K)
elif A + B >= K:
    print(A)
else:
    print(A - (K-A-B))

Buggy python submission (verdict: Runtime Error):
A,B,C,K=map(int, input().split(' '))
A_array, B_array, C_array, cards = [1] * A, [0] * B, [-1] * C, []
cards.extend(A_array)
cards.extend(B_array)
cards.extend(C_array)
total = 0
for _ in range(K):
    tmp = max(cards)
    total += tmp
    cards.remove(tmp)

print(total)

Fixed submission:
A,B,C,K=map(int, input().split(' '))
ans = 0
if A >= K:
    print(K)
elif A + B >= K:
    print(A)
else:
    print(A - (K-A-B))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    A,B,K=map(int, input().split())
    if A + B <= K:
        print('0 0')
        return
    for _ in range(K):
        if A >= 1:
            A -= 1
        else:
            if B >= 1:
                B -= 1
    print(A,B)
main()

Fixed submission:

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

if A >= K:
    print(f'{A-K} {B}')
elif (A+B) >= K:
    print(f'0 {B-(K-A)}')
else:
    print('0 0')
Buggy python submission (verdict: Runtime Error):
s = input()
# 頭とお尻の文字数を引く
n = len(s) - 2
# 頭とお尻をくっつくて出力
print(f'{s[0]}{n}{s[-1]}')


Fixed submission:
s = input()
# 頭とお尻の文字数を引く
n = len(s) - 2
# 頭とお尻をくっつくて出力
print(s[0] + str(n) + s[-1])
Buggy python submission (verdict: Runtime Error):

lst_A = list(input())

ans = "Bad"

for i in range(3):
	if lst_A[i] == lst_A[i + 1]
  		break
else:
  ans = "Good"
  
print(ans)


Fixed submission:
lst_A = list(input())
 
ans = "Bad"
 
for i in range(3):
	if lst_A[i] == lst_A[i + 1]:
  		break
else:
  ans = "Good"
  
print(ans)
Buggy python submission (verdict: Runtime Error):

import math

A, B, C, D = map(int, input().split())

A -= 1

E = (C * D) // math.gcd(C, D)

ans = (B - B // C - B // D + B // E) - (A - A // C - A // D + A // E)

print(ans)

Fixed submission:

A, B, C, D = map(int, input().split())

Cw = C
Dw = D

if Cw < Dw:
    Cw, Dw = Dw, Cw
while Cw % Dw != 0:
    Cw, Dw = Dw, Cw % Dw

E = C * D // Dw

A -= 1

ans = (B - B // C - B // D + B // E) - (A - A // C - A // D + A // E)

print(ans)

Buggy python submission (verdict: Runtime Error):

import math

A, B, C, D = map(int, input().split())

A -= 1

E = (C * D) // math.gcd(C, D)

ans = (B - B // C - B // D + B // E) - (A - A // C - A // D + A // E)

print(ans)

Fixed submission:

A, B, C, D = map(int, input().split())

Cw = C
Dw = D

if Cw < Dw:
    Cw, Dw = Dw, Cw
while Cw % Dw != 0:
    Cw, Dw = Dw, Cw % Dw

E = C * D // Dw

A -= 1

ans = (B - B // C - B // D + B // E) - (A - A // C - A // D + A // E)

print(ans)
Buggy python submission (verdict: Runtime Error):

X, A = map(int, input.()split())

if X < A:
  print(0)
else:
  print(10)

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

if X < A:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):

A = input()

lst_A = list(A)

lst_A.sort()

ans = int(lst_A[2]) * 10 + int(lst_A[0]) + int(lst_A[1])

print(ans)

Fixed submission:

lst_A = input().split()

lst_A.sort()

ans = int(lst_A[2]) * 10 + int(lst_A[0]) + int(lst_A[1])

print(ans)
Buggy python submission (verdict: Runtime Error):

N = int(input())

lst_W = []
for i in range(N):
    lst_W.extend(input().split())

ans = "Yes"

for i in range(N - 1):
    if (lst_W[i])[-1:] != (lst_W[i+1])[:1]:
        ans = "No"
        break

if len(lst_W) != len(set(lst_W)):
    #ans = "No"

print(ans)

Fixed submission:

N = int(input())

lst_W = []
for i in range(N):
    lst_W.extend(input().split())

ans = "Yes"

for i in range(N - 1):
    if (lst_W[i])[-1:] != (lst_W[i+1])[:1]:
        ans = "No"
        break

if len(lst_W) != len(set(lst_W)):
    ans = "No"

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())

lst_S = []
for i in range(N):
    lst_S.append(input().split())
    lst_S[i][0] = int(lst_S[i][0])
    lst_S[i][1] = int(lst_S[i][1])


bote_A = lst_S[0][0]
bote_B = lst_S[0][1]

for i in range(1, N):
    A_w = lst_S[i][0]
    B_w = lst_S[i][1]
    while 1:
        if (A_w >= bote_A) and (B_w >= bote_B):
            break
        else:
            A_w += lst_S[i][0]
            B_w += lst_S[i][1]
    bote_A = A_w
    bote_B = B_w

ans = bote_A + bote_B

print(ans)


Fixed submission:
N = int(input())

lst_S = []
for i in range(N):
    lst_S.append(input().split())
    lst_S[i][0] = int(lst_S[i][0])
    lst_S[i][1] = int(lst_S[i][1])

bote_A = lst_S[0][0]
bote_B = lst_S[0][1]

for i in range(1, N):
    bai_A = (bote_A - 1) // lst_S[i][0]
    bai_B = (bote_B - 1) // lst_S[i][1]

    bai = max(bai_A, bai_B) + 1

    bote_A = lst_S[i][0] * bai
    bote_B = lst_S[i][1] * bai

ans = bote_A + bote_B

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

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

if(A.index(0) >= 0):
    print(0)
    sys.exit(0)

prod = 1
for a in A:
    prod *= a
    if prod > 1000000000000000000:
        print(-1)
        sys.exit(0)

print(prod)

Fixed submission:
import sys

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

if(0 in A):
    print(0)
    sys.exit(0)

prod = 1
for a in A:
    prod *= a
    if prod > 1000000000000000000:
        print(-1)
        sys.exit(0)

print(prod)
Buggy python submission (verdict: Runtime Error):
import sys

try:
    d = int(input('D: '))
    t = int(input('T: '))
    s = int(input('S: '))
except ValueError:
    print('エラー：整数以外を入力しないでください')
    sys.exit(1)

if 1 <= d <= 10000 and 1 <= t <= 10000 and 1 <= s <= 10000:
    take_time = d / s
    if take_time <= t:
        print("Yes")
    else:
        print("No")
else:
    print('エラー：各入力は1～10000までの整数です')

Fixed submission:
import sys

try:
    #d = int(input('D: '))
    #t = int(input('T: '))
    #s = int(input('S: '))
    nums = [int(e) for e in input().split()]
except ValueError:
    print('エラー：整数以外を入力しないでください')
    sys.exit(1)

if 1 <= nums[0] <= 10000 and 1 <= nums[1] <= 10000 and 1 <= nums[2] <= 10000:
    take_time = nums[0] / nums[2]
    if take_time <= nums[1]:
        print("Yes")
    else:
        print("No")
else:
    print('エラー：各入力は1～10000までの整数です')

Buggy python submission (verdict: Runtime Error):
def ans():
    if t==0:
        return "N0"
    if d/s < = t:
        return "Yes"
    else:
        return "No"
        
d, t, s = map(int, input().split())
print(ans())

Fixed submission:
def ans():
    if t==0:
        return "N0"
    if d/s <= t:
        return "Yes"
    else:
        return "No"
        
d, t, s = map(int, input().split())
print(ans())
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))

p_max = max(p)

l_range = list(range(1001))
st = [sum(l_range[:i]) for i in range(1001)][1:]
#print(st)
table = [0] * (n + 1)
for i in range(1, len(table)):
    table[i] = table[i-1] + (st[p[i-1]] / p[i-1])
    #print(i, p[i-1], st[p[i-1]], table[i])
    
ans = table[k]
for i in range(k+1, len(table)):
    ans = max(ans, table[i] - table[i-k])

print(ans)



Fixed submission:
from itertools import accumulate

n, k = map(int, input().split())
p = list(map(int, input().split()))

st = list(accumulate(range(1001)))
#print(st)
table = [0] * (n + 1)
for i in range(1, len(table)):
    table[i] = table[i-1] + (st[p[i-1]] / p[i-1])
    #print(i, p[i-1], st[p[i-1]], table[i])
    
ans = table[k]
for i in range(k+1, len(table)):
    ans = max(ans, table[i] - table[i-k])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x, k, d = map(int, input().split())

past1_x = 0
past2_x = 0

result = 0

for i in range(k):
	past2_x = past1_x
	past1_x = x
	if x > 0:
		x -= d
	else:
		x += d
	
	if (past2_x == x and i != 0) or i == k - 1:
		if (k - i) % 2 == 0:
			result = abs(past1_x)
		else:
			result = abs(x)
		break

print(result)

Fixed submission:
x, k, d = map(int, input().split())

result = 0

abs_x = abs(x)
firstNearestIterNum = abs_x // d

if firstNearestIterNum >= k:
	result = abs_x - (d * k)
else:
	if (k - firstNearestIterNum) % 2 == 1:
		result = abs_x - (d * (firstNearestIterNum + 1))
	else:
		result = abs_x - d * firstNearestIterNum

print(abs(result))