Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def calcinput():
    a = input().split()
    a[0] = int(a[0])
    a[2] = int(a[2])

def main():
    while True:
        a = calcinput()
        if a[1] ==  "?": break
        a = a[0]; op = a[1]; b = a[2]
        if op == "+": print(a + b)
        elif op == "-": print(a - b)
        elif op == "*": print(a * b)
        elif op == "/": print(a // b)

if __name__ == "__main__":
    main()


Fixed submission:
def calcinput():
    a = input().split()
    a[0] = int(a[0])
    a[2] = int(a[2])
    return a
 
def main():
    while True:
        a = calcinput()
        if a[1] ==  "?": break
        x = a[0]; op = a[1]; y = a[2]
        if op == "+": print(x + y)
        elif op == "-": print(x - y)
        elif op == "*": print(x * y)
        elif op == "/": print(x // y)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def calcinput():
    a = input().split()
    a[0] = int(a[0])
    a[2] = int(a[2])
    return a
 
def main():
    while True:
        a = calcinput()
        if a[1] ==  "?": break
        a = a[0]; op = a[1]; b = a[2]
        if op == "+": print(a + b)
        elif op == "-": print(a - b)
        elif op == "*": print(a * b)
        elif op == "/": print(a // b)

if __name__ == "__main__":
    main()


Fixed submission:
def calcinput():
    a = input().split()
    a[0] = int(a[0])
    a[2] = int(a[2])
    return a
 
def main():
    while True:
        a = calcinput()
        if a[1] ==  "?": break
        x = a[0]; op = a[1]; y = a[2]
        if op == "+": print(x + y)
        elif op == "-": print(x - y)
        elif op == "*": print(x * y)
        elif op == "/": print(x // y)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# AOJ ITP1_7_B

def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    while True:
        a = numinput()
        n = a[0]; x = a[1]
        if n == 0 and x == 0: break
        # 1からnまでの異なる3つの数の和がxになる数の組の個数。
        count = 0
        for i in range(1, (x // 3) + 1):
            for j in range(i + 1, (x // 3) + 1):
                if j < x - i - j: count++
        print(count)

if __name__ == "__main__":
    main()


Fixed submission:
# AOJ ITP1_7_B

def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    while True:
        a = numinput()
        n = a[0]; x = a[1]
        if n == 0 and x == 0: break
        # 1からnまでの異なる3つの数の和がxになる数の組の個数。
        count = 0
        for i in range(1, (x // 3) + 1):
            for j in range(i + 1, n + 1):
                if j < x - i - j <= n:
                    count += 1
                    # print(str(i) + " " + str(j) + " " + str(x - i - j))
        print(count)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# AOJ ITP1_9_A

def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

# ※大文字と小文字を区別しないので注意！！！！
# 全部大文字にしちゃえ。
def main():
    W = input().upper()  # 大文字にする
    line = ""
    count = 0
    while True:
        line = input().split()
        if line == "END_OF_TEXT": break
        for i in range(len(line)):
            word = line[i].upper()
            if W == word: count += 1
    print(count)

if __name__ == "__main__":
    main()


Fixed submission:
# AOJ ITP1_9_A

# ※大文字と小文字を区別しないので注意！！！！
# 全部大文字にしちゃえ。
def main():
    W = input().upper()  # 大文字にする
    line = ""
    count = 0
    while True:
        line = input().split(" ")
        if line[0] == "END_OF_TEXT": break
        for i in range(len(line)):
            word = line[i].upper()
            if W == word: count += 1
    print(count)

if __name__ == "__main__":
    main()

# Accepted.
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
print(' '.join(sorted([a,b,c])))


Fixed submission:
n = list(map(int, input().split()))
n = sorted(n)
print(' '.join([str(x) for x in n]))
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
ans = "No"
if a < b < c:
    ans = "Yes"
print (ans)



Fixed submission:
a, b, c = map(int, input().split())
ans = "No"
if a < b < c:
    ans = "Yes"
print (ans)
Buggy python submission (verdict: Runtime Error):
l = [a,b,c,d,e,f,g,h,i,j]
a,b,c,d,e,f,g,h,i,j = int(input())
l.sort()
print(l[-1])
print(l[-2])
print(l[-3])

Fixed submission:
l = []
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
g = int(input())
h = int(input())
i = int(input())
j = int(input())

l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)
l.append(f)
l.append(g)
l.append(h)
l.append(i)
l.append(j)

l.sort()
print(l[-1])
print(l[-2])
print(l[-3])
Buggy python submission (verdict: Runtime Error):
x = int(input) 
print(x**3)

Fixed submission:
print(int(input())**3)

Buggy python submission (verdict: Runtime Error):
x = int(input)
print(x**3)

Fixed submission:
print(int(input())**3)

Buggy python submission (verdict: Runtime Error):
x = int(input) 
print(x**3)

Fixed submission:
print(int(input())**3)

Buggy python submission (verdict: Runtime Error):
print(int(input)**3)


Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
s=input();ans=""
for i in range(len(s)):
    if s[i].islower():
        ans+=s[i].upper(),end=""
    else:
        ans+=s[i].lower(),end=""
print(ans)


Fixed submission:
s=input();ans=""
for i in range(len(s)):
    if s[i].islower():
        ans+=s[i].upper()
    else:
        ans+=s[i].lower()
print(ans)
Buggy python submission (verdict: Runtime Error):
whlie True:
    a, b = row_input().strip().split(" ")
    print len(str(int(a) + int(b))))

Fixed submission:
#condig: UTF-8
 
while True:
    try:
        n = map(int, raw_input().split())
        s = len(str(n[0] + n[1]))
        print s
    except Exception:
        break

Buggy python submission (verdict: Runtime Error):
whlie True:
    a, b = raw_input().strip().split(" ")
    print len(str(int(a) + int(b))))

Fixed submission:
#condig: UTF-8
 
while True:
    try:
        n = map(int, raw_input().split())
        s = len(str(n[0] + n[1]))
        print s
    except Exception:
        break

Buggy python submission (verdict: Runtime Error):
while True:
    a, b = raw_input().strip().split(" ")
    print len(str(int(a) + int(b))))

Fixed submission:
#condig: UTF-8
 
while True:
    try:
        n = map(int, raw_input().split())
        s = len(str(n[0] + n[1]))
        print s
    except Exception:
        break

Buggy python submission (verdict: Runtime Error):
while True:
    a, b = raw_input().strip().split(" ")
    print len(str(int(a) + int(b)))

Fixed submission:
#condig: UTF-8
 
while True:
    try:
        n = map(int, raw_input().split())
        s = len(str(n[0] + n[1]))
        print s
    except Exception:
        break
Buggy python submission (verdict: Runtime Error):
for i in range(int(raw_input())):
&#160;&#160;&#160;&#160;sides = map(int, raw_input().split())
&#160;&#160;&#160;&#160;if sides[0]**2 == sides[1]**2 + sides[2]**2 or\
&#160;&#160;&#160;&#160;&#160;&#160;&#160;sides[1]**2 == sides[2]**2 + sides[0]**2 or\
&#160;&#160;&#160;&#160;&#160;&#160;&#160;sides[2]**2 == sides[0]**2 + sides[1]**2:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;print "YES"
&#160;&#160;&#160;&#160;else:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;print "NO"

Fixed submission:
x = int(input())
for a in range(x):
 y = map(int,raw_input().split())
 y.sort()
 if y[2]**2-y[1]**2 == y[0]**2:
  print "YES"
 else:
  print "NO"

Buggy python submission (verdict: Runtime Error):
for i in range(int(raw_input())):
&#160;&#160;&#160;&#160;sides = map(int, raw_input().split())
&#160;&#160;&#160;&#160;if sides[0]**2 == sides[1]**2 + sides[2]**2 or\
&#160;&#160;&#160;&#160;&#160;&#160;&#160;sides[1]**2 == sides[2]**2 + sides[0]**2 or\
&#160;&#160;&#160;&#160;&#160;&#160;&#160;sides[2]**2 == sides[0]**2 + sides[1]**2:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;print "YES"
&#160;&#160;&#160;&#160;else:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;print "NO"

Fixed submission:
x = int(input())
for a in range(x):
 y = map(int,raw_input().split())
 y.sort()
 if y[2]**2-y[1]**2 == y[0]**2:
  print "YES"
 else:
  print "NO"
Buggy python submission (verdict: Runtime Error):
" ".join(map(str, sorted(map(int, raw_input().strip().sprit(" ")), lambda x , y: y - x)))

Fixed submission:
l = map(int, raw_input().strip().split(" "));
print " ".join(map(str, sorted(l, lambda x, y: y - x)));

Buggy python submission (verdict: Runtime Error):
print " ".join(map(str, sorted(map(int, raw_input().strip().sprit(" ")), lambda x , y: y - x)))

Fixed submission:
l = map(int, raw_input().strip().split(" "));
print " ".join(map(str, sorted(l, lambda x, y: y - x)));

Buggy python submission (verdict: Runtime Error):
l = map(int, raw_input().strip().split(" "));
print " ".join(sorted(l, lambda x, y: y - x));

Fixed submission:
l = map(int, raw_input().strip().split(" "));
print " ".join(map(str, sorted(l, lambda x, y: y - x)));
Buggy python submission (verdict: Runtime Error):
import datetime

weekdays = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
]

while True:
  m, d = map(int, raw_input().strip().split(" "))
  print weekdays[datetime.date(2004, m, d).weekday()]

Fixed submission:
import datetime

weekdays = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
]

while True:
  m, d = map(int, raw_input().strip().split(" "))
  if m == 0:
    break
  print weekdays[datetime.date(2004, m, d).weekday()]
Buggy python submission (verdict: Runtime Error):

hist = [0 for i in range(100)]

l = []
while True:
  try:
    hist[input() - 1] += 1
  except:
    break;

for k in filter(lambda x: max(hist) == x[1], enumlate(hist)):
  print k[0] + 1

Fixed submission:

hist = [0 for i in range(100)]

l = []
while True:
  try:
    hist[input() - 1] += 1
  except:
    break;

for k in filter(lambda x: max(hist) == x[1], enumerate(hist)):
  print k[0] + 1
Buggy python submission (verdict: Runtime Error):
while True:
  words = raw_input().strip().split(" ")
  count = {};
  for word in words:
    s = count.setdefault(word, 0);
    count[word] = s + 1
  print max(count.items(), key=lambda x: x[1])[0], max(words, key=lambda x: len(x))

Fixed submission:

words = raw_input().strip().split(" ")
count = {};
for word in words:
  s = count.setdefault(word, 0);
  count[word] = s + 1
print max(count.items(), key=lambda x: x[1])[0], max(words, key=lambda x: len(x))
Buggy python submission (verdict: Runtime Error):
ball = 0
while True:
 try:
  a, b = map(lambda x: ord(x) - ord("A") raw_input().strip().split(","))
  if (a == ball):
   ball = b;

print chr(ball + ord("A"))

Fixed submission:
ball = 0
while True:
    try:
        a, b = map(lambda x: ord(x) - ord("A"), raw_input().strip().split(","))
        if (a == ball):
            ball = b;
        elif (b == ball):
            ball = a;
    except:
        break;

print chr(ball + ord("A"))

Buggy python submission (verdict: Runtime Error):
ball = 0
while True:
 try:
  a, b = map(lambda x: ord(x) - ord("A") raw_input().strip().split(","))
  if (a == ball):
   ball = b;
 except:
  break;

print chr(ball + ord("A"))

Fixed submission:
ball = 0
while True:
    try:
        a, b = map(lambda x: ord(x) - ord("A"), raw_input().strip().split(","))
        if (a == ball):
            ball = b;
        elif (b == ball):
            ball = a;
    except:
        break;

print chr(ball + ord("A"))
Buggy python submission (verdict: Runtime Error):
d = {};
d["A"] = 0;
d["B"] = 0;
d["AB"] = 0;
d["O"] = 0;

while True:
 b = raw_input().strip().split(",")[1]
 d[b] += 1;

print d["A"]
print d["B"]
print d["AB"]
print d["O"]

Fixed submission:
d = {};
d["A"] = 0;
d["B"] = 0;
d["AB"] = 0;
d["O"] = 0;

while True:
 try:
  b = raw_input().strip().split(",")[1]
  d[b] += 1;
 except:
  break;

print d["A"]
print d["B"]
print d["AB"]
print d["O"]
Buggy python submission (verdict: Runtime Error):
print raw_input().replace("apple", "!#$%!"#$").replace("peach", "apple").replace("!#$%!"#$", "peach")

Fixed submission:
print raw_input().replace("apple", "!#$%!#$").replace("peach", "apple").replace("!#$%!#$", "peach")
Buggy python submission (verdict: Runtime Error):
s = input()
n = input()
for i in range(n):
  x, y = input()-1, input()-1
  p = min(x, y, s - x - 1, s - y - 1)
  print p % 3 + 1

Fixed submission:

s = input()
n = input()
for i in range(n):
  x, y = map(int, raw_input().split(" "));
  x -= 1;
  y -= 1;
  p = min(x, y, s - x - 1, s - y - 1)
  print p % 3 + 1
Buggy python submission (verdict: Runtime Error):
p = "A"

while True:
    try:
        s, t = raw_input().split(",")
    except EOFError as e:
        break
    if s == p:
        p = t
    elif t == p:
        p = s

print("%s" % (chA, ))

Fixed submission:
p = {"A":True, "B":False, "C": False}

while True:
    try:
        s, t = raw_input().split(",")
    except EOFError as e:
        break
    p[s], p[t] = p[t], p[s]

for i in p:
    if p[i]:
        print("%s" % (i, ))
Buggy python submission (verdict: Runtime Error):
import math
main()

def prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            return False
    return True

def main():
    N = input()
    n = [input() for x in range(N)]
    c = 0

    for i in range(N):
        if prime(n[i]):
            c += 1

    print(c)

Fixed submission:
import math

def main():
    N = input()
    n = [input() for x in range(N)]
    c = 0

    for i in range(N):
        if prime(n[i]):
            c += 1

    print(c)

def prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            return False
    return True

main()
Buggy python submission (verdict: Runtime Error):
a, b = (raw_input().split())
a = int(a)
b = int(b)
print("%d %d", % (a*b, (a+b)*2))

Fixed submission:
a, b = map(int, raw_input().split())
print("%d %d" % (a*b, (a+b)*2))
Buggy python submission (verdict: Runtime Error):
t = input()
h = t // 3600
m = (t % 3600) // 60
s = t % 60
print("%d:%d:%d" % (h, m, s))



Fixed submission:
t = int(input())
h = t // 3600
m = (t % 3600) // 60
s = t % 60
print("%d:%d:%d" % (h, m, s))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
s = ""

if a < b:
    s = "a < b"
elif a > b:
    s = "a > b"
else:
    s = "a == b"

print(s)

Fixed submission:
a, b, c = map(int, raw_input().split())
print("Yes" if (a < b and b < c) else "No")
Buggy python submission (verdict: Runtime Error):
i = 0
while True:
    x = input()
    if x == 0:
        return 0
    i += 1
    print("Case %d: %d" % (i, x))

Fixed submission:
i = 0
while True:
    x = input()
    if x == 0:
        break
    i += 1
    print("Case %d: %d" % (i, x))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
print("%d %d %f", % (a//b, a%b, a/float(b)))

Fixed submission:
a, b = map(int, raw_input().split())
print("%d %d %f" % (a//b, a%b, a/float(b)))
Buggy python submission (verdict: Runtime Error):
def draw(h, w):
    print("#" * w)
    for i in range(h-2)
        print("#" + ("."*(w-2)) + "#")
    print("#" * w)
    print "\n"

while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    draw(h, w)

Fixed submission:
def draw(h, w):
    print("#" * w)
    for i in range(h-2):
        print("#" + ("."*(w-2)) + "#")
    print("#" * w)
    print("")

while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    draw(h, w)
Buggy python submission (verdict: Runtime Error):
def draw(h, w):
    for i in range(h):
        for j in range(w):
            print("#" if (i+j)%2 == 0 else ".", end='')
        print("")
    print("")

while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    draw(h, w)

Fixed submission:
def draw(h, w):
    for i in range(h):
        s = ""
        for j in range(w):
            s += ("#" if (i+j)%2 == 0 else ".")
        print(s)
    print("")

while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    draw(h, w)
Buggy python submission (verdict: Runtime Error):
input()
l = map(int, raw_input().split())
l.reverse()
print(" ".join(tuple(l)))

Fixed submission:
input()
l = map(int, raw_input().split())
l.reverse()
print(" ".join(map(str, l)))

Buggy python submission (verdict: Runtime Error):
input()
l = map(int, raw_input().split())
l.reverse()
print(" ".join(map(str, l))

Fixed submission:
input()
l = map(int, raw_input().split())
l.reverse()
print(" ".join(map(str, l)))
Buggy python submission (verdict: Runtime Error):
def main():
    k = [[[0 for x in range(10)] for in range(3)] for in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

Fixed submission:
def main():
    k = [[[0 for x in range(10)] for x in range(3)] for x in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" " + " ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

Buggy python submission (verdict: Runtime Error):
def main():
    k = [[[0 for x in range(10)] for in range(3)] for in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

Fixed submission:
def main():
    k = [[[0 for x in range(10)] for x in range(3)] for x in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" " + " ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

Buggy python submission (verdict: Runtime Error):
def main():
    k = [[[0 for x in range(10)] for in range(3)] for in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

Fixed submission:
def main():
    k = [[[0 for x in range(10)] for x in range(3)] for x in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" " + " ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

Buggy python submission (verdict: Runtime Error):
def main():
    k = [[[0 for x in range(10)] for in range(3)] for in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()

Fixed submission:
def main():
    k = [[[0 for x in range(10)] for x in range(3)] for x in range(4)]
    n = int(input())
    for i in range(n):
        b, f, r, v = map(int, raw_input().split())
        k[b-1][f-1][r-1] += v

    for b in range(4):
        for f in range(3):
            print(" " + " ".join(map(str, k[b][f])))
        if b != 3:
            print("#"*20)

main()
Buggy python submission (verdict: Runtime Error):
W = raw_input().lower()
c = 0

while True:
    T = raw_input().lower()
    if T == "END_OF_TEXT":
        break
    Ti = T.split()
    for i in Ti:
        if i == W:
            c += 1

print("%d" % (c, ))

Fixed submission:
W = raw_input().lower()
c = 0

while True:
    T = raw_input()
    if T == "END_OF_TEXT":
        break
    Ti = T.lower().split()
    for i in Ti:
        if i == W:
            c += 1

print("%d" % (c, ))
Buggy python submission (verdict: Runtime Error):
while True:
    s = raw_input()
    if s == "-":
        break

    for i in int(raw_input()):
        h = int(raw_input())
        s = s[h:] + s[0:h]

    print(s)

Fixed submission:
while True:
    s = raw_input()
    if s == "-":
        break

    for i in range(int(raw_input())):
        h = int(raw_input())
        s = s[h:] + s[0:h]

    print(s)
Buggy python submission (verdict: Runtime Error):
from itertools import *

def find(X):
    for a,b,c,d in permutations(X):
        for x,y,z in product("+-*",repeat=3):
            for f in ("(((%s%s%s)%s%s)%s%s)","(%s%s%s)%s(%s%s%s)"):
                t = f%(a,x,b,y,c,z,d)
                if eval(t)==10:
                    return t
    return 0

while True:
    X = map(int,raw_input().split())
    if X==(0,0,0,0):
        break
    print find(X)

Fixed submission:
from itertools import *

def find(X):
    for a,b,c,d in permutations(X):
        for x,y,z in product("+-*",repeat=3):
            for f in ("(((%s%s%s)%s%s)%s%s)","(%s%s%s)%s(%s%s%s)"):
                t = f%(a,x,b,y,c,z,d)
                if eval(t)==10:
                    return t
    return 0

while True:
    X = map(int,raw_input().split())
    if X==[0,0,0,0]:
        break
    print find(X)
Buggy python submission (verdict: Runtime Error):
A,B = map(int, raw_input().split())
C = input()
D = [input() for _ in range(N)]
D = sorted(D)[::-1]
price = A
cal = C
ans = cal/price
for d in D:
    cal += d
    price += B
    ans = max(ans, cal/price)
print ans

Fixed submission:
N = input()
A,B = map(int, raw_input().split())
C = input()
D = [input() for _ in range(N)]
D = sorted(D)[::-1]
price = A
cal = C
ans = cal/price
for d in D:
    cal += d
    price += B
    ans = max(ans, cal/price)
print ans

Buggy python submission (verdict: Runtime Error):
A,B = map(int, raw_input().split())
C = input()
D = [input() for _ in range(N)]
D = sorted(D)[::-1]
price = A
cal = C
ans = cal/price
for d in D:
    cal += d
    price += B
    ans = max(ans, cal/price)
print ans

Fixed submission:
N = input()
A,B = map(int, raw_input().split())
C = input()
D = [input() for _ in range(N)]
D = sorted(D)[::-1]
price = A
cal = C
ans = cal/price
for d in D:
    cal += d
    price += B
    ans = max(ans, cal/price)
print ans

Buggy python submission (verdict: Runtime Error):
A,B = map(int, raw_input().split())
C = input()
D = [input() for _ in range(N)]
D = sorted(D)[::-1]
price = A
cal = C
ans = cal/price
for d in D:
    cal += d
    price += B
    ans = max(ans, cal/price)
print ans

Fixed submission:
N = input()
A,B = map(int, raw_input().split())
C = input()
D = [input() for _ in range(N)]
D = sorted(D)[::-1]
price = A
cal = C
ans = cal/price
for d in D:
    cal += d
    price += B
    ans = max(ans, cal/price)
print ans

Buggy python submission (verdict: Runtime Error):
A,B = map(int, raw_input().split())
C = input()
D = [input() for _ in range(N)]
D = sorted(D)[::-1]
price = A
cal = C
ans = cal/price
for d in D:
    cal += d
    price += B
    ans = max(ans, cal/price)
print ans

Fixed submission:
N = input()
A,B = map(int, raw_input().split())
C = input()
D = [input() for _ in range(N)]
D = sorted(D)[::-1]
price = A
cal = C
ans = cal/price
for d in D:
    cal += d
    price += B
    ans = max(ans, cal/price)
print ans
Buggy python submission (verdict: Runtime Error):
import numpy as np

x = input()
print(x**3)

Fixed submission:
N = input()

print(N**3)

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

x = input()
print(x**3)
print("\n")

Fixed submission:
N = input()

print(N**3)

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

N = input()

print(N**3)

Fixed submission:
N = input()

print(N**3)

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

N = input()
print N**3

Fixed submission:
N = input()

print(N**3)