Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    return divisors

div = sorted(make_divisors(M))

i = 0
while i<=len(div) and M//div[i]>=N:
    ans = div[i]
    i+=1
    
print(ans)

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    return divisors

if N==1:
    print(M)

else:
    div = sorted(make_divisors(M))
    i = 0 
    while i<=len(div) and M//div[i]>=N:
        ans = div[i]
        i+=1
    print(ans)

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    return divisors

div = sorted(make_divisors(M))
i = 0
while M//div[i]>=N:
    ans = div[i]
    i+=1
    
print(ans)

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    return divisors

if N==1:
    print(M)

else:
    div = sorted(make_divisors(M))
    i = 0 
    while i<=len(div) and M//div[i]>=N:
        ans = div[i]
        i+=1
    print(ans)

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

div = sorted(make_divisors(M))
while M//div[i]>=N:
    ans = div[i]
    i+=1
    
print(ans)

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    return divisors

if N==1:
    print(M)

else:
    div = sorted(make_divisors(M))
    i = 0 
    while i<=len(div) and M//div[i]>=N:
        ans = div[i]
        i+=1
    print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
W = [input() for _ in range(N)]

from collections import Counter

dic = Counter(W)
flg = 0
for i in range(N):
    if dic[W[i]]!=1:
        flg=1
        

for j in range(N-1):
    if W[j][-1]!=W[j+1][1]:
        flg = 1

if flg!=1:
    print('Yes')
else:
    print('No')

Fixed submission:
N = int(input())
W = [input() for _ in range(N)]

from collections import Counter

dic = Counter(W)
flg = 0
for i in range(N):
    if dic[W[i]]!=1:
        flg=1
        

for j in range(N-1):
    if W[j][-1]!=W[j+1][0]:
        flg = 1

if flg!=1:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
W = [input() for _ in range(N)]

from collections import Counter

dic = Counter(W)
flg = 0
for i in range(N):
    if dic[W[i]]!=1:
        flg=1
        break

for j in range(N-1):
    if W[j][-1]!=W[j+1][1]:
        flg = 1
        break

if flg!=1:
    print('Yes')
else:
    print('No')

Fixed submission:
N = int(input())
W = [input() for _ in range(N)]

from collections import Counter

dic = Counter(W)
flg = 0
for i in range(N):
    if dic[W[i]]!=1:
        flg=1
        

for j in range(N-1):
    if W[j][-1]!=W[j+1][0]:
        flg = 1

if flg!=1:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np

H, W = map(int, input().split())
A = [np.array(list(map(int, input().split()))).astype("int64") for _ in range(H)]

odds = []
for i in range(H):
    for j in range(W):
        if A[i][j]%2!=0:
            odds.append([i+1, j+1])

diff = []
for k in range(len(odds)//2):
    d_x = odds[2*k+1][0]-odds[2*k][0]
    d_y = odds[2*k+1][1]-odds[2*k][1]
    diff.append([d_x, d_y])

odds = np.array(odds)
diff = np.array(diff)

N = sum(sum(diff))

print(N)

for i in range(len(odds)//2):
    j = 0
    k = 0
    temp = odds[2*i]
    if diff[i][0]!=0:
        x_unit = (diff[i]-diff[i][1]*np.array([0, 1]))//diff[i][0]
        while j<diff[i][0]:
            print(temp[0], temp[1], (temp+x_unit)[0], temp[1])
            temp += x_unit
            j+=1
    if diff[i][1]!=0:
        y_unit = (diff[i]-diff[i][0]*np.array([1, 0]))//diff[i][1]
        while k<diff[i][1]:
            print(temp[0], temp[1], temp[0], (temp+y_unit)[1])
            temp += y_unit
            k+=1

Fixed submission:
H, W = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(H)]

arr = []
for i in range(H-1):
    for j in range(W):
        if A[i][j]%2!=0:
            A[i+1][j]+=1
            arr.append([i+1, j+1, i+2, j+1])
            
for k in range(W-1):
    if A[H-1][k]%2!=0:
        A[H-1][k+1]+=1
        arr.append([H, k+1, H, k+2])
        
N = len(arr)

print(N)

for i in range(N): 
    print(arr[i][0], arr[i][1], arr[i][2], arr[i][3])

Buggy python submission (verdict: Runtime Error):
import numpy as np

H, W = map(int, input().split())
A = [np.array(list(map(int, input().split()))).astype("int64") for _ in range(H)]

odds = []
for i in range(H):
    for j in range(W):
        if A[i][j]%2!=0:
            odds.append([i+1, j+1])

diff = []
for k in range(n//2):
    d_x = odds[2*k+1][0]-odds[2*k][0]
    d_y = odds[2*k+1][1]-odds[2*k][1]
    diff.append([d_x, d_y])

odds = np.array(odds)
diff = np.array(diff)

N = sum(sum(diff))

print(N)

for i in range(len(odds)//2):
    j = 0
    k = 0
    temp = odds[2*i]
    if diff[i][0]!=0:
        x_unit = (diff[i]-diff[i][1])//diff[i][0]
        while j<diff[i][0]:
            print(temp[0], temp[1], (temp+x_unit)[0], temp[1])
            temp += x_unit
            j+=1
    if diff[i][1]!=0:
        y_unit = (diff[i]-diff[i][0])//diff[i][1]
        while k<diff[i][1]:
            print(temp[0], temp[1], temp[0], (temp+y_unit)[1])
            temp += y_unit
            k+=1

Fixed submission:
H, W = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(H)]

arr = []
for i in range(H-1):
    for j in range(W):
        if A[i][j]%2!=0:
            A[i+1][j]+=1
            arr.append([i+1, j+1, i+2, j+1])
            
for k in range(W-1):
    if A[H-1][k]%2!=0:
        A[H-1][k+1]+=1
        arr.append([H, k+1, H, k+2])
        
N = len(arr)

print(N)

for i in range(N): 
    print(arr[i][0], arr[i][1], arr[i][2], arr[i][3])
Buggy python submission (verdict: Runtime Error):
N, i = map(int, inout().split())
print(N-i+1)

Fixed submission:
N, i = map(int, input().split())
print(N-i+1)
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())

if len(S)==1:
    print(S[0])
    
else:
    lst = []
    for i in range(len(S)):
        if S[i]!='1':
            lst.append(i)
        
    if lst==[]:
        print('1')
    else    
        if K<lst[0]:
            print('1')
        else:
            print(S[lst[0]])

Fixed submission:
S = input()
K = int(input())

if len(S)==1:
    print(S[0])
    
else:
    lst = []
    for i in range(len(S)):
        if S[i]!='1':
            lst.append(i)
        
    if lst==[]:
        print('1')
    else:
        if K<lst[0]+1:
            print('1')
        else:
            print(S[lst[0]])

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

if len(S)==1:
    print(S[0])
    
else:
    lst = []
    for i in range(len(S)):
        if S[i]!='1':
            lst.append(i)
        
    if K<lst[0]:
        print('1')
    else:
        print(S[lst[0]])

Fixed submission:
S = input()
K = int(input())

if len(S)==1:
    print(S[0])
    
else:
    lst = []
    for i in range(len(S)):
        if S[i]!='1':
            lst.append(i)
        
    if lst==[]:
        print('1')
    else:
        if K<lst[0]+1:
            print('1')
        else:
            print(S[lst[0]])
Buggy python submission (verdict: Time Limit Exceeded):
N, M =map(int, input().split())
A = list(map(int, input().split()))

S = [0]
for i in range(N):
    S.append(A[i]+S[i])

pS = []
for j in range(N):
    for k in range(j, N):
        pS.append((S[k+1]-S[j])%M==0)

print(sum(pS))

Fixed submission:
from collections import Counter
from itertools import accumulate
 
N, M = map(int, input().split())
acc = [0]
acc.extend(accumulate(map(int, input().split())))

acc = Counter(a%M for a in acc)
print(sum(c*(c-1)//2 for c in acc.values()))
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

lengt = len(S)
lst = []

for i in range(length):
    lst.append(S[i: length]+S[0: i])
    
if T in lst:
    print('Yes')
else:
    print('No')

Fixed submission:
S = input()
T = input()

length = len(S)
lst = []

for i in range(length):
    lst.append(S[i: length]+S[0: i])
    
if T in lst:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()


w = S.count('W')
e = N-w
ans = 10**9
for i in range(N):
    tmp = S[0:i].count('W')
    ans = min(e+2*tmp+(S[i]=='W')*1-i-1, ans)
    
print(ans)

Fixed submission:
N = int(input())
S = input()

wcnt = [(S[0]=='W')*1]+[0]*(N-1)
for i in range(1, N):
    wcnt[i] = wcnt[i-1]+(S[i]=='W')*1

w = wcnt[N-1]
e = N-w
ans = 10**9
for j in range(N):
    tmp = wcnt[j]
    ans = min(e+2*wcnt[j]-(S[j]=='W')*1-1-j, ans)
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

ans = 10**9
for i in range(N):
    ans = min(S[0:i].count('W')+S[i+1:N].count('E'), ans)
    
print(ans)

Fixed submission:
N = int(input())
S = input()

wcnt = [(S[0]=='W')*1]+[0]*(N-1)
for i in range(1, N):
    wcnt[i] = wcnt[i-1]+(S[i]=='W')*1

w = wcnt[N-1]
e = N-w
ans = 10**9
for j in range(N):
    tmp = wcnt[j]
    ans = min(e+2*wcnt[j]-(S[j]=='W')*1-1-j, ans)
    
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

from itertools import combinations

def get_sieve_of_eratosthenes(n):
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    
def is_prime(n):
    import math
    for i in range(2, int(math.sqrt(n))+1):  
        if n % i == 0:
            return False

    return True

lst = get_sieve_of_eratosthenes(55555)

base = [11, 3, 7, 5, 31]
i = 5
cnt = 5
while cnt<N:
    flg = 0
    tmp = lst[i]
    comb = list(combinations(base, 4))
    for j in range(len(comb)):
        if is_prime(sum(comb[j])+tmp):
            flg = 1
            
    if flg==0:
        base.append(tmp)   
        cnt+=1
    i+=1
    
for k in range(N):
    print(base[k], end=' ')

Fixed submission:
N = int(input())
 
from itertools import combinations
 
def get_sieve_of_eratosthenes(n):
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

primes = get_sieve_of_eratosthenes(55555)

lst = []
for p in primes:
    if p%5==1:
        lst.append(p)

for i in range(N):
    print(lst[i], end=' ')
Buggy python submission (verdict: Runtime Error):
number = int(input())
return number**2

Fixed submission:
def calc_r(r):
  return r*r

r = int(input())
result = calc_r(r)
print(result)

Buggy python submission (verdict: Runtime Error):
N, S = input().split()
n = int(N)
if n % 2 > 0:
    print('No')
hN = n // 2
if S[:hN] == S[hN:n -1]:
    print('Yes')
else:
    print('No')


Fixed submission:
radius = int(input())
print(radius * radius)

Buggy python submission (verdict: Runtime Error):
import sys
args = sys.argv
radius = args[0]
print(radius * radius)

Fixed submission:
radius = int(input())
print(radius * radius)
Buggy python submission (verdict: Runtime Error):
N, S = map(string, input().split())
N = int(N)
if N % 2 > 0:
    print('No')
hN = N // 2
if S[:hN] == S[hN:N]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = [input() for i in range(2)]
N = int(s[0])
S = s[1]
if N % 2 > 0:
    print('No')
else:
    hN = N // 2
    if S[:hN] == S[hN:N]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
return r * r

Fixed submission:
import sys

if __name__ == '__main__':
  r = int(input())
  print(r * r)
Buggy python submission (verdict: Runtime Error):
import sys
 
if __name__ == '__main__':
  r = int(input())
  a = r.split('\n')
  n = a[0]
  s = a[1]
  print(n)


Fixed submission:
import sys
 
def exec(n, s):
  r = 'No'
  if n % 2 != 0:
    return r
  hs = s[0:int(n/2)]
  if hs + hs == s:
    r = 'Yes'
  return r
    
    
if __name__ == '__main__':
  r = [input(), input()]
  n = int(r[0])
  s = r[1]
  print(exec(n, s))

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

num = int(digits/2)

str_forward = str[num:]
str_backward = str[:num]


if str_forward == str_backward:
 print("Yes")
else:
 print("No")
~               

Fixed submission:
digits = int(input())
str = input()

num = int(digits/2)

str_forward = str[num:]
str_backward = str[:num]


if str_forward == str_backward:
 print("Yes")
else:
 print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
print(s*s)

Fixed submission:
r = int(input())
print(r * r)

Buggy python submission (verdict: Runtime Error):

r = int(input())

return r * r

Fixed submission:

r = int(input())
print(r*r)

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

Fixed submission:
print(int(input())**2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
ans = false
if N % 2 == 0:
  ans = S[:N//2] == S[N//2:]
print(ans)

Fixed submission:
N = int(input())
S = input()
ans = 'No'
if N % 2 == 0 and S[:N//2] == S[N//2:]:
  ans = 'Yes'
print(ans)

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

S1 = substr(S, 0, N)
if S == S1+S1:
    print ('Yes')
else:
    print('No')



Fixed submission:
N = int(input())
S = input()

if N%2==1:
    print ('No')
    exit()

if S[:N//2] == S[N//2:]:
    print ('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
r = input()
print(r*r)

Fixed submission:
r = int(input())
print(r ** 2)

Buggy python submission (verdict: Runtime Error):
r = input()[0]
print(r**2)

Fixed submission:
r = int(input())
print(r ** 2)

Buggy python submission (verdict: Runtime Error):
r**2

Fixed submission:
r = int(input())
print(r**2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
moji = input()
res = 'Yes'
if n % 2 == 1:
    res = 'No'
else:
    for i in range(int(n/2)):
        if moji[i] != moji[int(n/2)+1]:
            res = 'No'
            break
      
print(res)


Fixed submission:
r = int(input())
print(r*r)

Buggy python submission (verdict: Runtime Error):
r = int(nput())
print(int(r**2))

Fixed submission:
r = int(input())
print(r*r)
Buggy python submission (verdict: Runtime Error):
n = int(input())
moji = input()
res = 'Yes'
if n % 2 == 1:
    res = 'No'
else:
    for i in range(int(n/2)):
        if moji[i] != moji[int(n/2)+1]:
            res = 'No'
            break
      
print(res)


Fixed submission:
n = int(input())
moji = input()
res = 'Yes'
if n % 2 == 1:
    res = 'No'
else:
    for i in range(int(n/2)):
        if moji[i] != moji[int(n/2)+i]:
            res = 'No'
            break
      
print(res)

Buggy python submission (verdict: Runtime Error):
n = int(input)
moji = input()
res = 'Yes'
if n % 2 == 1:res = 'No'
else:
  for i in range(len(n/2)):
    if moji[i] != moji[n/2+1]:
      res = 'No'
      
print(res)

Fixed submission:
n = int(input())
moji = input()
res = 'Yes'
if n % 2 == 1:
    res = 'No'
else:
    for i in range(int(n/2)):
        if moji[i] != moji[int(n/2)+i]:
            res = 'No'
            break
      
print(res)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

c = 0
for i range(3):
  if S[i] == T[i]:
    c += 1
  else:
    next
    
print(c)

Fixed submission:
S = input()
T = input()

c = 0
for i in range(3):
  if S[i] == T[i]:
    c += 1
  else:
    next
    
print(c)
Buggy python submission (verdict: Runtime Error):
r = int(intput())
print(r**2)

Fixed submission:
r = int(input())
print(r**2)
Buggy python submission (verdict: Runtime Error):
def solve():
    n, data = [x for x in input().split(" ")]
    n = int(n)
    if data[:n//2] == data[n//2:]:
        return "Yes"
    return "No"

if __name__ == "__main__":
    # test = int(input())
    # for _ in test:
    print(solve())

Fixed submission:
n = int(input())
s = input()
if (s[0:n//2]==s[n//2:]):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
def solve():
    n, data = [x for x in input().split(" ")]
    n = int(n)
    if data[:n//2] == data[n//2:-1]:
        return "Yes"
    return "No"

if __name__ == "__main__":
    # test = int(input())
    # for _ in test:
    solve()

Fixed submission:
n = int(input())
s = input()
if (s[0:n//2]==s[n//2:]):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int solve()
{
    int a, b;
    string str;
    cin >> a >> b;
    if (a > 9 || b > 9)
        return -1;
    return a * b;
}
int main()
{
    cout << solve() << endl;
}

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

if(int(a)>9 or int(b)>9):
    print("-1")
else:
    print(int(a)* int(b))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
string solve()
{
    int N;
    cin>>N;
    int last = 1;
    for(int i=2; i*i<=N; i++){
        if(N%i==0){
            last = i;
        }
    }
    N = N/last;
    if(N>9 || last>9)return "No";
    return "Yes";
}
int main()
{
    cout << solve() << endl;
}

Fixed submission:
a = int(input())
if(a > 81 or a==0):
    print("No")
elif(0<a<10):
    print("Yes")
else:
    for i in range(9, 0, -1):
        if(a%i==0):
            a = a//i
            break
    if(a>9):
        print("No")
    else:
        print("Yes")

Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
string solve()
{
    int N;
    cin>>N;
    int last = 1;
    for(int i=2; i*i<=N; i++){
        if(N%i==0){
            last = i;
        }
    }
    N = N/last;
    if(N>9 || last>9)return "No";
    return "Yes";
}
int main()
{
    cout << solve() << endl;
}

Fixed submission:
a = int(input())
if(a > 81 or a==0):
    print("No")
elif(0<a<10):
    print("Yes")
else:
    for i in range(9, 0, -1):
        if(a%i==0):
            a = a//i
            break
    if(a>9):
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

n = int(input());
#n = [int(i) for i in input().split()];
#S = [str(s) for s in in_S]

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
    
m = make_divisors(n)
#print(m);

count = 0;
for i in range(0,len(m),2):
    #print(i);
    tmp =  (m[i]-1) + (m[i+1]-1);
    #print(tmp);
    if tmp < count or count == 0:
        count = tmp;
    #if n%i == 0 and n/i <= 9:
        #jud ='Yes';
print(count);


Fixed submission:
# coding: utf-8
# Your code here!

n = int(input());
#n = [int(i) for i in input().split()];
#S = [str(s) for s in in_S]

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            divisors.append(n//i)

    # divisors.sort()
    return divisors
    
m = make_divisors(n)
#print(m);

count = 0;
for i in range(0,len(m),2):
    #print(i);
    #if i==len(m)-1:
        #break;
    tmp =  (m[i]-1) + (m[i+1]-1);
    #print(tmp);
    if tmp < count or count == 0:
        count = tmp;
    #if n%i == 0 and n/i <= 9:
        #jud ='Yes';
print(count);
Buggy python submission (verdict: Runtime Error):
A = list1[0];   #A個口の電源タップ
B = list1[1];   #未使用の差込口を B口以上に拡張したい
#print(list1)
#print(list1[1])
addSupply = 1;
lack   = (B-A); #足りない個数
if lack >0 & B !=1 :
    addSupply = 1;
    addSupply += lack / (A-1); #残りの個数 

    if lack % (A-1) >0:
        addSupply +=1;
else :
    addSupply = 0;
print(int(addSupply));

Fixed submission:
list1 = [int(i) for i in input().split()];

A = list1[0];   #A個口の電源タップ
B = list1[1];   #未使用の差込口を B口以上に拡張したい
#print(list1)
#print(list1[1])
addSupply = 1;
lack   = (B-A); #足りない個数
if lack >0:
    addSupply = 1;
    addSupply += lack / (A-1); #残りの個数 
 
    if lack % (A-1) >0:
        addSupply +=1;
elif B==1 :
    addSupply = 0;

print(int(addSupply));
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A<=9 and B<=9:
    print(A*B)
else:
    print("-1")

Fixed submission:
A,B=map(int,input() .split())
if A<=9 and B<=9:
    print(A*B)
else:
    print('-1')
Buggy python submission (verdict: Time Limit Exceeded):
N,Y=map(int,input().split())
x,y,z=0,0,0
n=0
for i in range(0,N+1):
    a=Y-10000*i
    if a==0 and i==N:
        x,y,z=i,0,0
        break
    else:
        for j in range(0,N-i+1):
            b=a-5000*j
            if b==0 and i+j==N:
                x,y,z=i,j,0
                break
            else:
                for k in range(0,N-i-j+1):
                    c=b-1000*k
                    if c==0 and i+j+k==N:
                        x,y,z=i,j,k
                        break                      
if x==0 and y==0 and z==0:
    print(-1,-1,-1,sep=" ")
else:
    print(x,y,z,sep=" ")


Fixed submission:
import sys
N,Y=map(int,input().split())
n=0
for i in range(0,N+1):
    for j in range(0,N-i+1):
        k=N-i-j
        S=10000*i+5000*j+1000*k
        if (S==Y) and (k>=0):
            print(i,j,k,sep=" ")
            sys.exit()
        else:
            n=n+1
if n==(N+1)*(N+2)/2:
    print(-1,-1,-1,sep=" ")

Buggy python submission (verdict: Time Limit Exceeded):
N,Y=map(int,input().split())
x,y,z=0,0,0
n=0
for i in range(0,N+1):
    a=Y-10000*i
    if a==0 and i==N:
        x,y,z=i,0,0
    else:
        for j in range(0,N-i+1):
            b=a-5000*j
            if b==0 and i+j==N:
                x,y,z=i,j,0
            else:
                for k in range(0,N-i-j+1):
                    c=b-1000*k
                    if c==0 and i+j+k==N:
                        x,y,z=i,j,k                      
if x==0 and y==0 and z==0:
    print(-1,-1,-1,sep=" ")
else:
    print(x,y,z,sep=" ")


Fixed submission:
import sys
N,Y=map(int,input().split())
n=0
for i in range(0,N+1):
    for j in range(0,N-i+1):
        k=N-i-j
        S=10000*i+5000*j+1000*k
        if (S==Y) and (k>=0):
            print(i,j,k,sep=" ")
            sys.exit()
        else:
            n=n+1
if n==(N+1)*(N+2)/2:
    print(-1,-1,-1,sep=" ")
Buggy python submission (verdict: Runtime Error):
N=int(input())
x=N*800
y=N//15*200
S=x-y
print(S)v

Fixed submission:
N=int(input())
x=N*800
y=N//15*200
S=x-y
print(S)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a==b and b==c and a==c: #全部一緒のとき
    print("1")
elif a!=b and b!=c and a!=c: #全部違うとき
    print("3")
elif a==b and b!=c:
    print("2")
elif a==c and c!=b:
    print("2")
elif c==b and a!=c:
    print("2")

Fixed submission:
a,b,c=map(int,input().split())
if a==b and b==c and a==c: #全部一緒のとき
    print("1")
elif a!=b and b!=c and a!=c: #全部違うとき
    print("3")
elif a==b and b!=c:
    print("2")
elif a==c and c!=b:
    print("2")
elif c==b and a!=c:
    print("2")