Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
s = [ str(input()) for _ in range(n)]
s = sorted([sorted(x) for x in s])
pairs = 0
from math import factorial
# for i in range(n):
#     for j in range(i+1, n):
#         if s[i] == s[j]:
#             pairs.append(tuple([i,j]))
def comb(n, r):
    return (factorial(n) / factorial(r) / factorial(n - r))

i=0
while i < n-1:
    sames = 0
    for j in range(i+1, n):
        if s[i] == s[j]:
            sames += 1
            continue
        else:
            break
    i += sames + 1
    if sames != 0:
        pairs += comb(sames + 1, 2)

print(int(pairs))

Fixed submission:
n=int(input())
s = [ str(input()) for _ in range(n)]
s = sorted([sorted(x) for x in s])
pairs = 0
from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

i=0
while i < n-1:
    sames = 0
    for j in range(i+1, n):
        if s[i] == s[j]:
            sames += 1
            continue
        else:
            break
    i += sames + 1
    if sames != 0:
        pairs += combinations_count(sames + 1, 2)


print(int(pairs))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s = [ str(input()) for _ in range(n)]
s = [sorted(x) for x in s]
pairs =[]
for i in range(n):
    for j in range(i+1, n):
        if s[i] == s[j]:
            pairs.append(tuple([i,j]))
print(len(pairs))

Fixed submission:
n=int(input())
s = [ str(input()) for _ in range(n)]
s = sorted([sorted(x) for x in s])
pairs = 0
from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

i=0
while i < n-1:
    sames = 0
    for j in range(i+1, n):
        if s[i] == s[j]:
            sames += 1
            continue
        else:
            break
    i += sames + 1
    if sames != 0:
        pairs += combinations_count(sames + 1, 2)


print(int(pairs))
Buggy python submission (verdict: Runtime Error):
n=int(input())
p=list(map(int, input().split()))
ans=list(range(n) + 1)

ans_mix=[]
is_possible = False

if p==ans:
    is_possible = True

for i in range(0, n-1):
    for j in range(1, n):
        a=ans.copy()
        tmp=a[i]
        a[i]=a[j]
        a[j]=tmp
        if a==p:
            is_possible = True

if is_possible:
    print('YES')
else:
    print('NO')



Fixed submission:
n=int(input())
p=list(map(int, input().split()))
ans=list(range(1,n+1))

ans_mix=[]
is_possible = False

if p==ans:
    is_possible = True

for i in range(0, n-1):
    for j in range(1, n):
        a=ans.copy()
        tmp=a[i]
        a[i]=a[j]
        a[j]=tmp
        if a==p:
            is_possible = True

if is_possible:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
n=int(input())
p=list(map(int, input().split()))
ans=list(range(N) + 1)

ans_mix=[]
is_possible = False
for i in range(0, n-1):
    for j in range(1, n):
        a=ans.copy()
        tmp=a[i]
        a[i]=a[j]
        a[j]=tmp
        if a==p:
            is_possible = True
            
if is_possible:
    print('YES')
else:
    print('NO')
    

Fixed submission:
n=int(input())
p=list(map(int, input().split()))
ans=list(range(1,n+1))

ans_mix=[]
is_possible = False

if p==ans:
    is_possible = True

for i in range(0, n-1):
    for j in range(1, n):
        a=ans.copy()
        tmp=a[i]
        a[i]=a[j]
        a[j]=tmp
        if a==p:
            is_possible = True

if is_possible:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
n,*p=[int(t.split())for t in open(0)]
print(sum([(p[i+1]-p[i])*(p[i]-p[i-1]) < 0 for i in range(1,n)]))

Fixed submission:

n = int(input())
p = list(map(int,input().split()))
print(sum([max(p[i+1],p[i],p[i-1]) != p[i] and min(p[i+1],p[i],p[i-1]) != p[i] for i in range(1,n-1)]))
Buggy python submission (verdict: Runtime Error):
s=list(str(int(input())))
print('Bad' if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] else 'Good')


Fixed submission:
s=list(str(input()))
print('Bad' if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] else 'Good')
Buggy python submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())
A = 0
B = 0
ans = 0
pre_ans = 0
for i in range(N):
    if x[i]>=0 and y[i]>=0:
        A+=x[i]
        B+=y[i]
    elif x[i]*y[i]<0 and x[i]+y[i]>0:
        A+=x[i]
        B+=y[i]
ans = (A**2+B**2)**0.5

A = 0
B = 0
for i in range(N):
    if x[i]>=0 and y[i]<=0:
        A+=x[i]
        B+=y[i]
    elif x[i]*y[i]>0 and x[i]-y[i]>0:
        A+=x[i]
        B+=y[i]
pre_ans = (A**2+B**2)**0.5
if pre_ans > ans:
    ans = pre_ans

A = 0
B = 0
for i in range(N):
    if x[i]<=0 and y[i]<=0:
        A+=x[i]
        B+=y[i]
    elif x[i]*y[i]<0 and x[i]+y[i]<0:
        A+=x[i]
        B+=y[i]
pre_ans = (A**2+B**2)**0.5
if pre_ans > ans:
    ans = pre_ans

A = 0
B = 0
for i in range(N):
    if x[i]<=0 and y[i]>=0:
        A+=x[i]
        B+=y[i]
    elif x[i]*y[i]>0 and -x[i]+y[i]>0:
        A+=x[i]
        B+=y[i]
pre_ans = (A**2+B**2)**0.5
if pre_ans > ans:
    ans = pre_ans





print(ans)


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

ans = 0
if S[0:1] == T[0:1]:
    ans +=1

if S[1:2] == T[1:2]:
    ans +=1

if S[2:3] == T[2:3]:
    ans +=1

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

cin = sys.stdin
# cin = open("in.txt", "r")


def line2N():
    return map(int, cin.readline().split())


N, M = line2N()
x = [0] * N
y = [0] * N
z = [0] * N
for i in range(N):
    x[i], y[i], z[i] = line2N()

vis = [False] * N
pool = set(range(N))

if M==0:
    print(0)
    exit(0)

rMax = 0
for k0 in range(N):
    k = k0
    pool = set(range(N))
    x0, y0, z0 = x[k], y[k], z[k]
    pool.remove(k)
    for i in range(M-1):
        k = -1
        maxV = 0
        for p in pool:
            v = abs(x0 + x[p]) + abs(y0+y[p]) + abs(z0+z[p])
            if v>maxV:
                maxV = v
                k = p
        x0, y0, z0 = x0 + x[k], y0+y[k], z0+z[k]
        pool.remove(k)
    maxV = abs(x0) + abs(y0) + abs(z0)
    if rMax<maxV:
        rMax = maxV

print(rMax)


Fixed submission:
import sys
import itertools

cin = sys.stdin
# cin = open("in.txt", "r")


def line2N():
    return map(int, cin.readline().split())


N, M = line2N()
if M==0:
    print(0)
    exit(0)
x = [0] * N
y = [0] * N
z = [0] * N
for i in range(N):
    x[i], y[i], z[i] = line2N()

rMax = 0
for sx, sy, sz in itertools.product((-1,1), repeat=3):
    s = [sx * xi + sy * yi + sz * zi for xi, yi, zi in zip(x, y, z)]
    s.sort()
    rMax = max(rMax, sum(s[-M:]))

print(rMax)
Buggy python submission (verdict: Runtime Error):
import sys
from collections import deque

cin = sys.stdin
# cin = open("in.txt", "r")

def line2N():
    return map(int, cin.readline().split())


N, = line2N()
adj = [[] for i in range(N+1)]
for i in range(N-1):
    u, v = line2N()
    adj[u].append(v)
    adj[v].append(u)

color = [0]*(N+1)
h_cnt = 1
t_cnt = 1
dq_head = deque([1])
dq_head.append(2)
dq_tail = deque([N])
for step in range(N):
    if step % 2==0:
        u = dq_head.popleft()
        for v in adj[u]:
            if color[v]==0:
                color[v] = 1
                dq_head.append(v)
                h_cnt += 1
    else:
        u = dq_tail.popleft()
        for v in adj[u]:
            if color[v]==0:
                color[v] = 2
                dq_tail.append(v)
                t_cnt += 1

if h_cnt>t_cnt:
    print("Fennec")
else:
    print("Snuke")



Fixed submission:
import sys
from collections import deque

cin = sys.stdin
# cin = open("in.txt", "r")

def line2N():
    return map(int, cin.readline().split())


N, = line2N()
adj = [[] for i in range(N+1)]
for i in range(N-1):
    u, v = line2N()
    adj[u].append(v)
    adj[v].append(u)

color = [0]*(N+1)
h_cnt = 1
t_cnt = 1
dq_head = deque([1])
color[1] = 1
dq_tail = deque([N])
color[N] = 1
for step in range(N):
    if step % 2==0:
        if not dq_head:
            t_cnt = N - h_cnt
            break
        dq_head_n = deque()
        for u in dq_head:
            for v in adj[u]:
                if color[v]==0:
                    color[v] = 1
                    dq_head_n.append(v)
                    h_cnt += 1
        dq_head = dq_head_n

    else:
        if not dq_tail:
            h_cnt = N - t_cnt
            break
        dq_tail_n = deque()
        for u in dq_tail:
            for v in adj[u]:
                if color[v]==0:
                    color[v] = 2
                    dq_tail_n.append(v)
                    t_cnt += 1
        dq_tail = dq_tail_n

# print(h_cnt, t_cnt)
if h_cnt > t_cnt:
    print("Fennec")
else:
    print("Snuke")
Buggy python submission (verdict: Runtime Error):
import sys

cin = sys.stdin
cin = open("in.txt", "r")

x = int(cin.readline())
c = x//11
cnt = c*2
r = x%11
# print(r)
if r>0:
    cnt +=1
    if r>6:
        cnt +=1

print(cnt)


Fixed submission:
import sys

cin = sys.stdin

x = int(cin.readline())
c = x//11
cnt = c*2
r = x%11
# print(r)
if r>0:
    cnt +=1
    if r>6:
        cnt +=1

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

cin = sys.stdin
cin = open("in.txt", "r")

MODULO = int(10**9+7)
N = int(cin.readline())
A = list(map(int, cin.readline().split()))
pos = [0]*(N)
if (N%2==1):
    pos[N//2+1]=1
for ai in A:
    if (ai+N)%2==0:
        print(0)
        exit()
    pos[ai]+=1
    if pos[ai]>2:
        print(0)
        exit()
cnt = 1
for i in range(N//2):
    cnt = cnt * 2 % MODULO
print(cnt)

Fixed submission:
import sys

cin = sys.stdin
#cin = open("in.txt", "r")

MODULO = int(10**9+7)
N = int(cin.readline())
A = list(map(int, cin.readline().split()))
pos = [0]*(N+1)
if (N%2==1):
    pos[0]=1
for ai in A:
    if (ai+N)%2==0 or ai>=N or ai<0:
        print(0)
        exit()
    pos[ai]+=1
    if pos[ai]>2:
        print(0)
        exit()
cnt = 1
for i in range(N//2):
    cnt = cnt * 2 % MODULO
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
HN = list(map(int, input().split(" ")))

Max = 0

i = 0
while i < (N - 1):
    Count = 0
    NowHeight = HN[i]
    for j in range(i+1, N):
        NextHeight = HN[j]
        if NowHeight >= NextHeight:
            NowHeight = NextHeight
            Count = Count + 1
        else:
            break
    if Count > Max:
        Max = Count
        i = i + 1 + Count
    else:
        i = i + 1

print(Max)

Fixed submission:
N = int(input())
HN = list(map(int, input().split(" ")))
 
Max = 0
 
i = 0
while i < (N - 1):
    Count = 0
    NowHeight = HN[i]
    for j in range(i+1, N):
        NextHeight = HN[j]
        if NowHeight >= NextHeight:
            NowHeight = NextHeight
            Count = Count + 1
        else:
            break
    if Count > Max:
        Max = Count
    i = i + 1 + Count
 
print(Max)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
HN = list(map(int, input().split(" ")))

Max = 0

for i in range(N - 1):
    Count = 0
    NowHeight = HN[i]
    for j in range(i+1, N):
        NextHeight = HN[j]
        if NowHeight >= NextHeight:
            NowHeight = NextHeight
            Count = Count + 1
        else:
            break
    if Count > Max:
        Max = Count
    if N - i <= Max:
        break

print(Max)

Fixed submission:
N = int(input())
HN = list(map(int, input().split(" ")))
 
Max = 0
 
i = 0
while i < (N - 1):
    Count = 0
    NowHeight = HN[i]
    for j in range(i+1, N):
        NextHeight = HN[j]
        if NowHeight >= NextHeight:
            NowHeight = NextHeight
            Count = Count + 1
        else:
            break
    if Count > Max:
        Max = Count
    i = i + 1 + Count
 
print(Max)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
HN = list(map(int, input().split(" ")))

Max = 0

for i in range(N - 1):
    Count = 0
    NowHeight = HN[i]
    for j in range(i+1, N):
        NextHeight = HN[j]
        if NowHeight >= NextHeight:
            NowHeight = NextHeight
            Count = Count + 1
        else:
            break
    if Count > Max:
        Max = Count

print(Max)

Fixed submission:
N = int(input())
HN = list(map(int, input().split(" ")))
 
Max = 0
 
i = 0
while i < (N - 1):
    Count = 0
    NowHeight = HN[i]
    for j in range(i+1, N):
        NextHeight = HN[j]
        if NowHeight >= NextHeight:
            NowHeight = NextHeight
            Count = Count + 1
        else:
            break
    if Count > Max:
        Max = Count
    i = i + 1 + Count
 
print(Max)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define int ll
const ll mod = 1000000007;

using namespace std;

int n, m;
int s[2010], t[2010];
int dp[2010][2010];

signed main() {
    cin >> n >> m;
    for (int i = 0; i < n; i++) cin >> s[i];
    for (int i = 0; i < m; i++) cin >> t[i];

    for (int i = 0; i <= 2009; i++) {
        for (int j = 0; j <= 2009; j++) {
            dp[i][j] = 1;
        }
    }

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
            dp[i][j] += mod - dp[i-1][j-1];
            if (s[i - 1] == t[j - 1]) dp[i][j] += dp[i - 1][j - 1];
            dp[i][j] %= mod;
        }
    }

    cout << dp[n][m] << endl;
}

// 共通部分列


Fixed submission:
MOD = 10**9 + 7

n,m = (int(num) for num in input().split())
s = [int(num) for num in input().split()]
t = [int(num) for num in input().split()]

dp = [[1]*(m+1) for _ in range(n+1)]

for i in range(1,n+1):
    for j in range(1,m+1):
        dp[i][j] = dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1]
        if s[i-1] == t[j-1]:
            dp[i][j] += dp[i-1][j-1]
        dp[i][j] = dp[i][j] % MOD
        
        
print(dp[n][m])
Buggy python submission (verdict: Runtime Error):
n, k, q = list(map(int, input().split()))
a = [0] * q
for i in range(q):
  a[i] = int(input())

cur_k = [k] * n

for i in range(q):
  cur_k[a[i] - 1] += 1

for i in cur_k:
  if (i > q):
    print("Yes")
  else:
    print("No")

Fixed submission:
s = input()

if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = list(map(int, input().split()))
a = []
for i in range(q):
  a.append(int(input()))

cur_k = [k] * n

for i in range(q):
  for j in range(n):
    if (a[i] - 1) != j:
      cur_k[j] -= 1
#  print(a[i], cur_k)
    

for i in cur_k:
  if (i > 0):
    print("Yes")
  else:
    print("No")

Fixed submission:
n, k, q = list(map(int, input().split()))
a = [0] * q
for i in range(q):
  a[i] = int(input())

cur_k = [k] * n

for i in range(q):
  cur_k[a[i] - 1] += 1

for i in cur_k:
  if (i > q):
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())

print(n ** 3

Fixed submission:
n = int(input())

print(n ** 3)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    cnt = 0
  ansers.append(cnt)

print(max(ansers))

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    ansers.append(cnt)
    cnt = 0
else:
  ansers.append(cnt)

print(max(ansers))

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    ansers.append(cnt)
    cnt = 0
  ansers.append(cnt)

print(max(ansers))


Fixed submission:
n = int(input())
h = list(map(int, input().split()))

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    ansers.append(cnt)
    cnt = 0
else:
  ansers.append(cnt)

print(max(ansers))
Buggy python submission (verdict: Runtime Error):
S = input()
if S[0::2].count("L") + S[1::2].count("R") == 0: print("Yes")
  else: print("No")



Fixed submission:
S = input()
if S[0::2].count("L") + S[1::2].count("R") == 0: print("Yes")
else: print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
if S[0::2].count("L") + S[1::2].count("R") = 0: print("Yes")
  else: print("No")



Fixed submission:
S = input()
if S[0::2].count("L") + S[1::2].count("R") == 0: print("Yes")
else: print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

count
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

count = 0
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(input().split()))

count
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))

count = 0
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)
Buggy python submission (verdict: Runtime Error):
if int(input())>=3200: print(input()) else print('red')

Fixed submission:
a = int(input())
s = input()
if a>=3200: print(s)
else: print('red')

Buggy python submission (verdict: Runtime Error):
if int(input())>=3200: print(input());else: print('red')

Fixed submission:
a = int(input())
s = input()
if a>=3200: print(s)
else: print('red')
Buggy python submission (verdict: Runtime Error):
N = int(input())
v = list(map(int, input().split()))

v_sorted = sorted(v)

out = 0
for i in range(N-1):
  out += v_sorted[i]*(1/2)^(N-1-i)

print(out+v_sorted[-1]*(1/2))

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

v_s = sorted(v)

out = 0
for i in range(N):
  if i == 0:
    out += v_s[i]*((1/2)**(N-1))
  else:
    out += v_s[i]*((1/2)**(N-i))
  
print(out)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()
if a < 3200:
  print('red')
else:
  print(s

Fixed submission:
a = int(input())
s = input()
if a < 3200:
  print('red')
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
m=""
for i in range(len(a)):
    m=m+a[i]+b[i]
    i +=1
print(m)

Fixed submission:
a=list(input())
b=list(input())+[""]
for x,y in zip(a,b):
    print(x+y, end="")
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
 
 
N, K, Q = map(int, input().split(' '))
a = [int(input()) for _ in range(Q)]
 
num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1
 
for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')

Fixed submission:
S = input()
weather_dic = {'Sunny': 'Cloudy', 'Cloudy': 'Rainy', 'Rainy': 'Sunny'}
print(weather_dic[S])

Buggy python submission (verdict: Runtime Error):
from collections import defaultdict


N, K, Q = list(map(int, input().split(' ')))
a = [int(input()) for _ in range(N)]

num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1

for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')



Fixed submission:
S = input()
weather_dic = {'Sunny': 'Cloudy', 'Cloudy': 'Rainy', 'Rainy': 'Sunny'}
print(weather_dic[S])
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict


N, K, Q = list(map(int, input().split()))
a = [int(input()) for _ in range(N)]

num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1

for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')



Fixed submission:
from collections import defaultdict

N, K, Q = map(int, input().split(' '))
a = [int(input()) for _ in range(Q)]

num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1

for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')
Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split(' '))
yy = y // 1000
d = yy - n
a = (4 * d - n - 3 * yy) / 5
b = (8 * yy - 9 * d + n) / 5
if a>= 0 and b >= 0 and c >= 0:
	print(a, b, c)
else:
	print('-1 -1 -1')

Fixed submission:
n, y = [int(x) for x in input().split(' ')]
q, mod = divmod(y, 10000)

if n * 10000 > y and y > (n-1)* 10000 + 5000:
	print('-1 -1 -1')
else:
	if q == n and mod == 0:
		print('{} 0 0'.format(q))
	else:
		for a in range(q+1):
			b = int((y - 1000 * n - 9000 * a) / 4000)
			c = int((5000 * n - y + 5000 * a) / 4000)
			if a + b + c == n and a >= 0 and b >= 0 and c >= 0 and 10000 * a + 5000 * b + 1000 * c == y:
				print('{} {} {}'.format(a, b, c))
				break
		else:
			print('-1 -1 -1')

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split(' '))
yy = y / 1000
d = yy - n
a = (4 * d - n - 3 * yy) / 5
b = (8 * yy - 9 * d + n) / 5
if a>= 0 and b >= 0 and c >= 0:
	print(a, b, c)
else:
	print('-1 -1 -1')

Fixed submission:
n, y = [int(x) for x in input().split(' ')]
q, mod = divmod(y, 10000)

if n * 10000 > y and y > (n-1)* 10000 + 5000:
	print('-1 -1 -1')
else:
	if q == n and mod == 0:
		print('{} 0 0'.format(q))
	else:
		for a in range(q+1):
			b = int((y - 1000 * n - 9000 * a) / 4000)
			c = int((5000 * n - y + 5000 * a) / 4000)
			if a + b + c == n and a >= 0 and b >= 0 and c >= 0 and 10000 * a + 5000 * b + 1000 * c == y:
				print('{} {} {}'.format(a, b, c))
				break
		else:
			print('-1 -1 -1')
Buggy python submission (verdict: Runtime Error):
now_wether = input() 

if now_wether == "Sunny":
  print(Cloudy)
elif now_wether == "Cloudy":
  print(Rainy)
else:
  print(Sunny)
  
  
  

 

Fixed submission:
now_wether = input() 

if now_wether == "Sunny":
  print("Cloudy")
elif now_wether == "Cloudy":
  print("Rainy")
else:
  print("Sunny")