Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A, B, C, D, E, limit = map(int, input().rstrip("\n").split())

target_rate = E * 100 / (100 + E)
water_vars = {(i * A + j * B) * 100 for i in range(limit // (100 * A) + 1) for j in range(limit // (100 * B) + 1) if (i * A + j * B) * 100 <= limit}
water_vars = sorted(water_vars)
ans_solution = 0
ans_sugar = 0
min_rate_dest = 100

for water in water_vars:
    sugar_limit = limit - water
    sugar_vars = {i * C + j * D for i in range(sugar_limit // C + 1) for j in range(sugar_limit // D + 1) if i * C + j * D <= sugar_limit}
    sugar_vars = sorted(sugar_vars)
    for sugar in sugar_vars:
        rate = sugar * 100 / (sugar + water)
        if target_rate - rate == 0:
            ans_solution = water + sugar
            ans_sugar = sugar
            break
        elif 0 < target_rate - rate < min_rate_dest:
            ans_solution = water + sugar
            ans_sugar = sugar
            min_rate_dest = target_rate - rate
        else:
            break

print(ans_solution, ans_sugar)


Fixed submission:
A, B, C, D, E, limit = map(int, input().rstrip("\n").split())

target_concent = E * 100 / (100 + E)
water_vars = {(i * A + j * B) * 100 for i in range(limit // (100 * A) + 1) for j in range(limit // (100 * B) + 1) if (i * A + j * B) * 100 <= limit}
water_vars = sorted(water_vars)[1:]

ans_solution = 0
ans_sugar = 0
max_concent = 0

break_all = False

for water in water_vars:
    sugar_limit = limit - water
    sugar_vars = {i * C + j * D for i in range(sugar_limit // C + 1) for j in range(sugar_limit // D + 1) if i * C + j * D <= sugar_limit}
    sugar_vars = sorted(sugar_vars)
    for sugar in sugar_vars:
        concent = sugar * 100 / (sugar + water)
        if concent == target_concent:
            ans_solution = water + sugar
            ans_sugar = sugar
            break_all = True
            break
        elif max_concent <= concent < target_concent:
            ans_solution = water + sugar
            ans_sugar = sugar
            max_concent = concent
        elif concent > target_concent:
            break
    if break_all:
        break

print(ans_solution, ans_sugar)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
list_ = [int(input()) for _ in range(n)]

print(sum(list_.count(key) % 2 for key in set(list_)))



Fixed submission:
n = int(input())
list_ = [int(input()) for _ in range(n)]

dict_ = dict()
for key in list_:
    dict_[key] = dict_.get(key, 0) + 1
print(sum(num % 2 for num in dict_.values()))

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

dict_ = dict()
for key in set(list_):
    dict_[key] += dict_.get(key, 0) + 1
print(sum(num % 2 for num in dict_.values()))

Fixed submission:
n = int(input())
list_ = [int(input()) for _ in range(n)]

dict_ = dict()
for key in list_:
    dict_[key] = dict_.get(key, 0) + 1
print(sum(num % 2 for num in dict_.values()))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
list_ = [int(input()) for _ in range(n)]

print(sum(list_.count(key) % 2 for key in set(list_)))


Fixed submission:
n = int(input())
list_ = [int(input()) for _ in range(n)]

dict_ = dict()
for key in list_:
    dict_[key] = dict_.get(key, 0) + 1
print(sum(num % 2 for num in dict_.values()))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from scipy.sparse import csr_matrix, csgraph
N = int(input())
row, column, data = zip(*tuple(tuple(map(lambda n: int(n) - 1, input().split())) for _ in range(N - 1)))
Q, K = map(int, input().split())
dist = csgraph.dijkstra(csr_matrix(([d + 1 for d in data], (row, column)), (N, N), dtype=np.int64), directed=False, indices=[K - 1])[0]
for _ in range(Q):
    indices = list(map(lambda n: int(n) - 1, input().split()))
    print(int(dist[indices].sum()))

Fixed submission:
from collections import deque
N = int(input())
graph = [[] for _ in range(N)]
for _ in range(N - 1):
    a, b, c = map(int, input().split())
    graph[a - 1].append((b - 1, c))
    graph[b - 1].append((a - 1, c))
Q, K = map(int, input().split())
visited = [0] * N
visited[K - 1] = 1
q = deque([(K - 1, 0)])
while q:
    p, c = q.popleft()
    for dst, d in graph[p]:
        if not visited[dst]:
            visited[dst] = c + d
            q.append((dst, c + d))
for _ in range(Q):
    x, y = map(lambda n: int(n) - 1, input().split())
    print(visited[x] + visited[y])
Buggy python submission (verdict: Time Limit Exceeded):
input()
iter_ = iter(map(int, input().rstrip("\n").split()))

sum_ = next(iter_)
ans = 0

for num in iter_:
    if sum_ == 0:
        sum_ += 1
        ans += 1
    presum = sum_
    sum_ += num
    while presum * sum_ >= 0:
        sum_ += -1 if presum > 0 else 1
        ans += 1

print(ans)

Fixed submission:
input()
seq = list(map(int, input().rstrip("\n").split()))

iter_ = iter(seq)
ans1 = 0
for i, num in enumerate(iter_):
    if i == 0:
        sum_ = num
        if sum_ > 0:
            pass
        else:
            ans1 += abs(sum_ - 1)
            sum_ = 1
    else:
        sum_ += num
        if i % 2:
            if sum_ < 0:
                pass
            else:
                ans1 += abs(sum_ + 1)
                sum_ = -1
        else:
            if sum_ > 0:
                pass
            else:
                ans1 += abs(sum_ - 1)
                sum_ = 1

iter_ = iter(seq)
ans2 = 0
for i, num in enumerate(iter_):
    if i == 0:
        sum_ = num
        if sum_ < 0:
            pass
        else:
            ans2 += abs(sum_ + 1)
            sum_ = -1
    else:
        sum_ += num
        if i % 2:
            if sum_ > 0:
                pass
            else:
                ans2 += abs(sum_ - 1)
                sum_ = 1
        else:
            if sum_ < 0:
                pass
            else:
                ans2 += abs(sum_ + 1)
                sum_ = -1

print(min(ans1, ans2))

Buggy python submission (verdict: Time Limit Exceeded):
input()
iter_ = iter(map(int, input().rstrip("\n").split()))

sum_ = next(iter_)
ans = 0

for num in iter_:
    presum = sum_
    sum_ += num
    while presum * sum_ >= 0:
        sum_ += -1 if presum > 0 else 1
        ans += 1

print(ans)


Fixed submission:
input()
seq = list(map(int, input().rstrip("\n").split()))

iter_ = iter(seq)
ans1 = 0
for i, num in enumerate(iter_):
    if i == 0:
        sum_ = num
        if sum_ > 0:
            pass
        else:
            ans1 += abs(sum_ - 1)
            sum_ = 1
    else:
        sum_ += num
        if i % 2:
            if sum_ < 0:
                pass
            else:
                ans1 += abs(sum_ + 1)
                sum_ = -1
        else:
            if sum_ > 0:
                pass
            else:
                ans1 += abs(sum_ - 1)
                sum_ = 1

iter_ = iter(seq)
ans2 = 0
for i, num in enumerate(iter_):
    if i == 0:
        sum_ = num
        if sum_ < 0:
            pass
        else:
            ans2 += abs(sum_ + 1)
            sum_ = -1
    else:
        sum_ += num
        if i % 2:
            if sum_ > 0:
                pass
            else:
                ans2 += abs(sum_ - 1)
                sum_ = 1
        else:
            if sum_ < 0:
                pass
            else:
                ans2 += abs(sum_ + 1)
                sum_ = -1

print(min(ans1, ans2))
Buggy python submission (verdict: Runtime Error):
n = input()
iter_ = iter(list(map(int, input().rstrip("\n").split())))
ans = 0

last = next(iter_)
try:
    while True:
        ans += 1
        now = next(iter_)
        while now == last:
            now = next(iter_)
        laststate = (last < now)
        state = laststate
        print(f"out: {last}, {now}")
        while state == laststate:
            last = now
            now = next(iter_)
            while now == last:
                now = next(iter_)
            state = (last < now)
            print(f"in: {last}, {now}")
        last = now
except StopIteration:
    print(ans)


Fixed submission:
n = input()
iter_ = iter(list(map(int, input().rstrip("\n").split())))
ans = 0

last = next(iter_)
try:
    while True:
        ans += 1
        now = next(iter_)
        while now == last:
            now = next(iter_)
        laststate = (last < now)
        state = laststate
        while state == laststate:
            last = now
            now = next(iter_)
            while now == last:
                now = next(iter_)
            state = (last < now)
        last = now
except StopIteration:
    print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
iter_ = iter(list(map(int, input().rstrip("\n").split())))
ans = 0

last = next(iter_)
try:
    while True:
        ans += 1
        now = next(iter_)
        while now == last:
            now = next(iter_)
        laststate = (last < now)
        state = laststate
        print(f"out: {last}, {now}")
        while state == laststate:
            last = now
            now = next(iter_)
            while now == last:
                now = next(iter_)
            state = (last < now)
            print(f"in: {last}, {now}")
        last = now
except StopIteration:
    print(ans)

Fixed submission:
n = input()
iter_ = iter(list(map(int, input().rstrip("\n").split())))
ans = 0

last = next(iter_)
try:
    while True:
        ans += 1
        now = next(iter_)
        while now == last:
            now = next(iter_)
        laststate = (last < now)
        state = laststate
        while state == laststate:
            last = now
            now = next(iter_)
            while now == last:
                now = next(iter_)
            state = (last < now)
        last = now
except StopIteration:
    print(ans)
Buggy python submission (verdict: Runtime Error):
print("ARC" if int(input) > 1200 else "ABC")


Fixed submission:
print("ARC" if int(input()) >= 1200 else "ABC")
Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().rstrip("\n").split())
print(sum([x + y + z == s for x in range(k + 1) for y in range(k + 1) for z in range(k + 1)]))


Fixed submission:
print(input().replace(",", " "))

Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().rstrip("\n").split())
print(sum([x + y + z == s for x in range(k + 1) for y in range(k + 1) for z in range(k + 1)]))


Fixed submission:
print(input().replace(",", " "))
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().rstrip("\n").split())
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        if x + y > s:
            break
        for z in range(k + 1):
            count += (x + y + z == s)

print(count)

Fixed submission:
k, s = map(int, input().rstrip("\n").split())
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        if x + y > s:
            x = k + 1
            y = k + 1
            continue
        count += (s <= x + y + k)

print(count)

Buggy python submission (verdict: Runtime Error):
for x in range(k + 1):
    for y in range(k + 1):
        if x + y > s:
            break
        for z in range(k + 1):
            count += (x + y + z == s)

print(count)


Fixed submission:
k, s = map(int, input().rstrip("\n").split())
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        if x + y > s:
            x = k + 1
            y = k + 1
            continue
        count += (s <= x + y + k)

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().rstrip("\n").split())
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            count += (x + y + z == s)

print(count)


Fixed submission:
k, s = map(int, input().rstrip("\n").split())
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        if x + y > s:
            x = k + 1
            y = k + 1
            continue
        count += (s <= x + y + k)

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().rstrip("\n").split())
print(sum([x + y + z == s for x in range(k + 1) for y in range(k + 1) for z in range(k + 1)]))


Fixed submission:
k, s = map(int, input().rstrip("\n").split())
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        if x + y > s:
            x = k + 1
            y = k + 1
            continue
        count += (s <= x + y + k)

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().rstrip("\n").split())
print(sum([x + y + z == s for x in range(k + 1) for y in range(k + 1) for z in range(k + 1)]))


Fixed submission:
k, s = map(int, input().rstrip("\n").split())
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        if x + y > s:
            x = k + 1
            y = k + 1
            continue
        count += (s <= x + y + k)

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools as itr

k, s = map(int, input().rstrip("\n").split())
print(sum([sum(p) == s for p in itr.product(range(k + 1), repeat=3)]))


Fixed submission:
k, s = map(int, input().rstrip("\n").split())
count = 0

for x in range(k + 1):
    for y in range(k + 1):
        if x + y > s:
            x = k + 1
            y = k + 1
            continue
        count += (s <= x + y + k)

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
from re import sub

dest = input().rstrip("\n")

suffixes = ["dream$", "dreamer$", "erase$", "eraser$"]

while True:
    len_before = len(dest)
    for suffix in suffixes:
        dest = sub(suffix, "", dest)
    if len(dest) == len_before:
        break

print("YES" if not dest else "NO")


Fixed submission:
dest = input().rstrip("\n")

suffixes = ["dream", "dreamer", "erase", "eraser"]
cut_lens = [-5, -7, -5, -6]

while True:
    for suffix, cut_len in zip(suffixes, cut_lens):
        if dest.endswith(suffix):
            dest = dest[:cut_len]
            break
    else:
        break

print("YES" if not dest else "NO")
Buggy python submission (verdict: Runtime Error):
nums = list(input().strip())
N = len(nums)
head = nums.pop(0)
print(sum(eval(head + "".join([f"{'' if (j >> i) % 2 else '+'}{n}" for i, n in enumerate(nums)])) for j in range(2 ** (N - 1))))


Fixed submission:
nums = list(input().strip())
N = len(nums)
head = nums.pop(0)
print(sum(eval(head + "".join([('' if (j >> i) % 2 else '+') + str(n) for i, n in enumerate(nums)])) for j in range(2 ** (N - 1))))
Buggy python submission (verdict: Runtime Error):
[print("".join(sorted(input() for _ in range(l)))) for n, l in [map(int, input().split())]]


Fixed submission:
n, l = map(int, input().rstrip("\n").split())
strings = sorted([input().rstrip() for _ in range(n)])

print("".join(strings))
Buggy python submission (verdict: Runtime Error):
import math

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)

n, m = map(int, input().split())
a = [int(x) for x in input().split()]
g = a[0]
for i in range(n):
	g = lcm(g, a[i])
while g % 2 == 0:
	g //= 2

rb = m // g
if rb % 2 == 0:
	print(rb // 2)
else:
	print(rb // 2 + 1)

Fixed submission:
k, x = map(int, input().split())
ans = 'Yes' if 500 * k >= x else 'No'
print(ans)
Buggy python submission (verdict: Runtime Error):
a, v = map(int, input()) 
b, w = map(int, input())
t = int(input()) 
if v <= w:
  print('NO') 
else:
  q = abs(a-b) / abs(v - w) 
  if abs(a-b) * t <= abs(v - w):
    print('YES') 
  else:
    print('NO') 

Fixed submission:
a, v = map(int, input().split()) 
b, w = map(int, input().split())
t = int(input()) 
if v <= w:
  print('NO') 
else:
  q = abs(a-b) / abs(v - w) 
  if abs(a-b) <= abs(v - w) * t:
    print('YES') 
  else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
x = list(map(int,input().split()))
length = 0
Khalf = K//2
for i in range(N):
	if x[i] <= Khalf:
		length += 2*x[i]
	else:
		length += 2*(K-x[i])
print(length)


Fixed submission:
N = int(input())
A = int(input())
print(N**2-A)

Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
x = list(map(int,input().split()))
length = 0
Khalf = K//2
for i in range(N):
	if x[i] <= Khalf:
		length += 2*x[i]
	else:
		length += 2*(K-x[i])
print(length)



Fixed submission:
N = int(input())
A = int(input())
print(N**2-A)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
A = [0] + list(map(int, input().split()))
now = 1
used = [0] * (n + 191)
used[1] = 1
for _ in range(k):
    now = A[now]
    if used[now] != 0:
        cn = _+1-used[now]+1
        break
    used[now] = _ + 1
for i in range(k % cn):
    now = A[now]
print(now)

Fixed submission:
n, k = map(int, input().split())
A = [0] + list(map(int, input().split()))
now = 1
used = [-228] * (n + 191)
used[1] = -1
cn = -292
ahah = 1
for _ in range(k):
    now = A[now]
    if used[now] != -228:
        cn = _ + 1 - used[now] - 1
        break
    used[now] = _
    ahah += 1
if cn == -292:
    print(now)
    exit(0)
for i in range((k - ahah) % cn):
    now = A[now]
print(now)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
cnt=[[0]*60 for i in range(2)]
for a in A:
    for i in range(60):
        if(a&(1<<i)):
            cnt[1][i]+=1
        else:
            cnt[0][i]+=1
res=0
for i in range(60):
    x = pow(2,i)
    x%=1000000007
    res+=cnt[1][i]*cnt[0][i]*x
    res%=1000000007
print(res)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
cnt=[[0]*60 for i in range(2)]
for a in A:
    for i in range(60):
        if(a&(1<<i)):
            cnt[1][i]+=1
        else:
            cnt[0][i]+=1
res=0
for i in range(60):
    x = pow(2,i)
    x%=1000000007
    res+=cnt[1][i]*cnt[0][i]*x
    res%=1000000007
print(res)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip> // cout<<setprecision(n)
#include <functional> // std::function<void(int)>
using namespace std;
#define All(v) (v).begin(),(v).end()
const long long mod = 1000000007;
const long long inf = mod*mod;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
signed main(){
    int a,b,c;
    cin >> a >> b >> c;
    cout << max(c - a + b, 0) << endl;
}

Fixed submission:
a, b, c = map(int, input().split())
print(max(c-(a-b),0))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
cnt = 0
res = []
for i in range(n - 1, -1, -1):
    c = i + 1
    if (A[i] % 2 == 1):
        cnt += 1
        res.append(c)
        for k in range(1, int(c ** 0.5) + 1):
            if (c % k == 0):
                if (k != c // k):
                    A[k - 1] -= 1
                    A[c // k - 1] -= 1
                else:
                    A[k - 1] -= 1
print(cnt)
print(*res)

Fixed submission:
from copy import deepcopy
n = int(input())
A = list(map(int,input().split()))
AA = deepcopy(A)
f = [0]*n
m = 0
b = []
for i in range(n-1,0,-1):
    if A[i]%2==0:
        continue
    b.append(i+1)
    m += 1
    for k in range(1,int((i+1)**0.5)+1):
        if (i+1)%k == 0:
            if(k-1!=(i+1)//k-1):
                A[k-1] -= 1
                A[(i+1)//k-1] -= 1
                f[k-1] += 1
                f[(i+1)//k-1] += 1
            else:
                A[k-1] -= 1
                f[k-1] += 1

if f[0]%2 !=AA[0]%2:
    b.append(1)
    m += 1
for i in range(1,n):
    if f[i]%2 != AA[i]:
        print(-1)
        exit()
print(m)
if m==0:
    exit()
print(*b)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
edge = [[-1] for _ in range(n+1)]
for i in range(m):
    a,b = [int(i) for i in input().split()]
    edge[a].append(b)
    edge[b].append(a)
if(m&1==1):
    print(-1)
    exit()
print(edge)
for i in range(n+1):
    if len(edge[i])==2:
        l = edge[i][1]
        print(l,i)
        edge[l][0] -= 1
        edge[l].remove(i)
        edge[i].clear()
for i in range(n+1):
    if edge[i][0]%2==0:
        for e in edge[i][1:]:
            if edge[e][0]%2==1:
                print(i,e)
                edge[i][0] -= 1
                edge[i].remove(e)
                edge[e].remove(i)
for i in range(n+1):
    if len(edge[i])==2:
        l = edge[i][1]
        print(l,i)
        edge[l][0] -= 1
        edge[l].remove(i)
        edge[i].clear()
    for e in edge[i][1:]:
        if len(edge[e])==2:
            continue
        print(i,e)
        edge[i][0] -= 1
        edge[i].remove(e)
        edge[e].remove(i)
print(edge)


Fixed submission:
from sys import setrecursionlimit
setrecursionlimit(10 ** 8)

n, m = map(int,input().split())
A = [[int(i) for i in input().split()] for i in range(m)]

if m&1:
    print(-1)
    exit()

E = [[] for i in range(n + 1)]
used_e = [False] * m
ans = []

for i, (a, b) in enumerate(A):
    E[a].append((b, i))
    E[b].append((a, i))

used = [False] * (n + 1)

def dfs(prev, v):
    if used[v]:
        return
    used[v] = True
    cnt = 0

    for to, i in E[v]:
        dfs(v, to)
        if not used_e[i]:
            cnt += 1

    for to, i in E[v]:
        if cnt % 2 == 1 and to == prev:
            continue
        if not used_e[i]:
            ans.append((v, to))
            used_e[i] = True

dfs(0, 1)

for a in ans:
    print(*a)
Buggy python submission (verdict: Runtime Error):
s = input()
if s[0]==s[1] or s[1]==s[2] or s[2]==-s[3]:
    print("Good")
else:
    print("Bad")

Fixed submission:
s = input()
for i in range(1,4):
    if s[i]==s[i-1]:
        print("Bad")
        exit()
print("Good")
Buggy python submission (verdict: Runtime Error):
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;

#define rep(i,a,n) for(int i=a;i<n;i++)
#define rrep(i,a,n) for(int i=a:i<n;i--)

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << min({ a + b,b + c,c + a }) << endl;
}

Fixed submission:
a,b,c = map(int,input().split())
print(min(a+b,b+c,c+a))