Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A,B= list(input().split())
a = int(B[0])
b = int(B[2])
c = int(B[3])
if int(A) > 1000:
   e = int(A[-2])
   f = int(A[-1])
   d = (int(A)- 10 * e - f)/100
   error = 10 * (c * e + b * f) + c * f
   error = int(error/100)
   ans = int(A) * a + 10 * d * b + e * b + c * d + error
   print(ans)
else:
   print(int(int(A)*float(B))

Fixed submission:
A,B= list(input().split())
a = int(B[0])
b = int(B[2])
c = int(B[3])
if int(A) > 1000:
   e = int(A[-2])
   f = int(A[-1])
   d = int((int(A)- 10 * e - f)/100)
   error = 10 * (c * e + b * f) + c * f
   error = int(error/100)
   ans = int(A) * a + 10 * d * b + e * b + c * d + error
   print(int(ans))
else:
   print(int(int(A)*float(B)))

Buggy python submission (verdict: Runtime Error):
A,B= list(input().split())
a = int(B[0])
b = int(B[2])
c = int(B[3])
e = int(A[-2])
f = int(A[-1])
d = (int(A)- 10*e - f)/100
error = 10 * (c * e + b * f) + c * f
error = int(error/100)
ans = int(A) * a + 10 * d * b + e * b + c * d + error
print(ans)

Fixed submission:
A,B= list(input().split())
a = int(B[0])
b = int(B[2])
c = int(B[3])
if int(A) > 1000:
   e = int(A[-2])
   f = int(A[-1])
   d = int((int(A)- 10 * e - f)/100)
   error = 10 * (c * e + b * f) + c * f
   error = int(error/100)
   ans = int(A) * a + 10 * d * b + e * b + c * d + error
   print(int(ans))
else:
   print(int(int(A)*float(B)))

Buggy python submission (verdict: Runtime Error):
A,B= list(input().split())
a = int(B[0])
b = int(B[2])
c = int(B[3])
d = int(A[0])
e = int(A[1])
f = int(A[2])
error = 10 * (c * e + b * f) + c * f
error = int(error/100)
ans = int(A) * a + 10 * d * b + e * b + c * d + error
print(ans)

Fixed submission:
A,B= list(input().split())
a = int(B[0])
b = int(B[2])
c = int(B[3])
if int(A) > 1000:
   e = int(A[-2])
   f = int(A[-1])
   d = int((int(A)- 10 * e - f)/100)
   error = 10 * (c * e + b * f) + c * f
   error = int(error/100)
   ans = int(A) * a + 10 * d * b + e * b + c * d + error
   print(int(ans))
else:
   print(int(int(A)*float(B)))
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
max_D = int(1 + math.sqrt(N))
count = []
for i in range(max_D):
   if N % i == 0:
      count.append([0])
      while N%i == 0:
         N = N / i
         count[-1] += 1
   if N < i:
      break
l = len(count)
ans = 0
for i in range(l):
   E = count[i]
   j = 0
   while j * (j + 1) <= 2 * E:
      j += 1
   ans += j - 1
print(ans)

Fixed submission:
import math
N = int(input())
max_D = int(2 + math.sqrt(N))
count = []
ans = 1
for i in range(2, max_D):
   if N % i == 0:
      count.append(0)
      while N % i == 0:
         N = N // i
         count[-1] += 1
   if N < i:
      ans = 0
      break
l = len(count)
for i in range(l):
   E = 2*count[i]
   j = 0
   while j * (j + 1) <= E:
      j += 1
   ans += j - 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import deque
import sys
N, M = list(map(int, input().split))
ans = [[] * N]
visited = [[False] * N]
dq = deque([0])
path = [[0] * N]
for s in sys.stdin.readlines():
    a, b = map(lambda: int(x)-1, s.split())
    path[a].add(b)
    path[b].add(a)
while dq:
   i = dq.popleft()
   if visited[i]:
      continue
   visited[i] = True
   next_rs = path[i]
   for i in range(len(next_rs)):
      dq.append(next_rs[i])
      ans[next_rs[i]] = i
if sum(visited) == N:
   print('Yes')
   for i in range(N):
      if i == 0:
         continue
      else:
         print(ans[i])
else:
   print(-1)

Fixed submission:
from collections import deque
import sys
N, M = list(map(int, input().split()))
ans = [-1] * N
visited = [False] * N
dq = deque([0])
path = [[] for _ in range(N)]
for s in sys.stdin.readlines():
    a, b = list(map(lambda x: int(x)-1, s.split()))
    path[a].append(b)
    path[b].append(a)
while dq:
   i = dq.popleft()
   if visited[i]:
      continue
   visited[i] = True
   next_rs = path[i]
   for j in range(len(next_rs)):
      if not visited[next_rs[j]]:
         dq.append(next_rs[j])
         if ans[next_rs[j]] == -1:
            ans[next_rs[j]] = i
if sum(visited) == N:
   print('Yes')
   for i in range(N):
      if i == 0:
         continue
      else:
         print(ans[i]+1)
else:
   print(-1)
Buggy python submission (verdict: Runtime Error):
D = int(input()), T = int(input()), S = int(input())

travel_time = D * S
if travel_time <= T:
  print "yes"
  else: print "no"
  

Fixed submission:
d,s,t = map(int,input().split())
print('Yes' if d/s <= t else 'No')

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

travel_time = D * S
if travel_time <= T:
  print "yes"
  else: print "no"
  

Fixed submission:
d,s,t = map(int,input().split())
print('Yes' if d/s <= t else 'No')
Buggy python submission (verdict: Runtime Error):
print(int((N+X-1)/X) * T)

Fixed submission:
n, x, t = map(int, input().split())
print(int((n+x-1)/x) * t)
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x >= 30:
  print("Yes")
  else:
    print("No")


Fixed submission:
x = int(input())
if x >= 30:
  print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
x = int(input())
if x >= 30:
  print("yes")
  else:
    print("No")

Fixed submission:
x = int(input())
if x >= 30:
  print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
print(a + a ** 2 + a *** 3)

Fixed submission:
a = int(input())
print(a + a ** 2 + a ** 3)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for i in range(k):
  price += p[i]
  
print(price)


Fixed submission:
alpha = input()
print('A' if alpha.isupper() else 'a')

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for i in range(k):
	  price += p[i]
  
print(price)


Fixed submission:
alpha = input()
print('A' if alpha.isupper() else 'a')

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
ans = 0

for i in range(k):
  ans += p[i]
  
print(ans)


Fixed submission:
alpha = input()
print('A' if alpha.isupper() else 'a')

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for i in range(k):
  price += p[i]
  
print(price)


Fixed submission:
alpha = input()
print('A' if alpha.isupper() else 'a')

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0
for i in range(k):
  price += p[i]
print(price)


Fixed submission:
alpha = input()
print('A' if alpha.isupper() else 'a')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for p in range(k):
  price += p[k]
  
print(price)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for i in range(k):
  price += p[i]
  
print(price)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for p in range(k):
  price += p[k]
 
print(price)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for i in range(k):
  price += p[i]
  
print(price)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
for i in range(k):
  price += p[i]
print(price)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for i in range(k):
  price += p[i]
  
print(price)
Buggy python submission (verdict: Runtime Error):
n = input()
if n[-1] in "24579":
  print("hon")
elif n[-1] in "0168":
  print("pon")
elif n[-1] in "3"
  print("bon")


Fixed submission:
n = input()
if n[-1] in "24579":
  print("hon")
elif n[-1] in "0168":
  print("pon")
elif n[-1] in "3":
  print("bon")

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n[-1] in "24579":
  print("hon")
elif n[-1] in "0168":
  print("pon")
elif n[-1] in "3"
  print("bon")


Fixed submission:
n = input()
if n[-1] in "24579":
  print("hon")
elif n[-1] in "0168":
  print("pon")
elif n[-1] in "3":
  print("bon")

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n[-1] = 2, 4, 5, 7, 9:
  print("hon")
elsif n[-1] = 0, 1, 6, 8:
  print("pon")
else:
  print("bon")

Fixed submission:
n = input()
if n[-1] in "24579":
  print("hon")
elif n[-1] in "0168":
  print("pon")
elif n[-1] in "3":
  print("bon")
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

if t = (s + 1):
  print("Yes")
else:
  print("No")

Fixed submission:
s = input()
t = input()

if s == t[:-1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
  
print(max(-1, n - sum(a))


Fixed submission:
R = int(input())
import math
pi = math.pi
print(2 * pi * R)
Buggy python submission (verdict: Runtime Error):
n = int(input())

if "7" in n:
    print("Yes")
else:
    print("No")



Fixed submission:
n = input()

if "7" in n:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())
if n >= 10:
  print r
else:
  print r + (100 * (10 - n))

Fixed submission:
n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r + (100 * (10 - n)))

Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())
if n >= 10:
  print r
else:
  print r + 100 * (10 - n)


Fixed submission:
n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r + (100 * (10 - n)))
Buggy python submission (verdict: Runtime Error):
s, t = input().split()
a, b = map(int, input().split())
u = str(input())
 
if u = s:
  print(a-1, b)
else:
  print(a, b-1)

Fixed submission:
s, t = input().split()
a, b = map(int, input().split())
u = str(input())
 
if u==s:
  print(a-1, b)
else:
  print(a, b-1)

Buggy python submission (verdict: Runtime Error):
s, t = map(str, input().split())
a, b = map(int, input().split())
u = str(input())

if u = s:
  print(a-1, b)
else:
  print(a, b-1)


Fixed submission:
s, t = input().split()
a, b = map(int, input().split())
u = str(input())
 
if u==s:
  print(a-1, b)
else:
  print(a, b-1)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
ans = 0

for i in range(s):
  ans += s[i] == t[i]

print(ans)

Fixed submission:
s = input()
t = input()
ans = 0

for i in range(3):
  ans += s[i] == t[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
d = int(input())
if d = 25:
  print("Christmas")
elif d = 24:
  print("Christmas Eve")
elif d = 23:
  print("Christmas Eve Eve")
elif d = 22:
  print("Christmas Eve Eve Eve")

Fixed submission:
d = int(input())
if d == 25:
  print("Christmas")
elif d == 24:
  print("Christmas Eve")
elif d == 23:
  print("Christmas Eve Eve")
elif d == 22:
  print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a > b or a = 1:
  print("Alice")
elif b > a or b = 1:
  print("Bob")

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

if int(a) == 1 and int(b) != 1:
    print("Alice")
elif int(a) != 1 and int(b) == 1:
    print("Bob")
elif int(a) > int(b):
    print("Alice")
elif int(a) < int(b):
    print("Bob")
elif int(a) == int(b):
    print("Draw")
Buggy python submission (verdict: Runtime Error):
D, T, S = (int(d) for d in input().split())

if T * s >= D:
    print("Yes")

else:
    print("No")

Fixed submission:
D, T, S = (int(d) for d in input().split())

if T * S >= D:
    print("Yes")

else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(d) for d in input().split()]

MOD = int(1e9+7)

ans = 0

for i in range(N-1):
    for j in range(i+1, N):
        t = ((A[i] * A[j]) % MOD + ans)% MOD
        ans = t

print(ans)

Fixed submission:
N = int(input())
A = [int(d) for d in input().split()]

MOD = int(1e9+7)

A_cum = [0]
for i in range(N):
    A_cum.append((A_cum[-1] + A[i]) % MOD)

ans = 0
for i in range(N-1):
    t = (A[i] * (A_cum[-1] - A_cum[i+1]) % MOD ) % MOD
    ans = (t + ans)% MOD

print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = (int(d) for d in input().split())

C = [[] for i in range(N+1)]
for i in range(M):
    A, B = (int(d) for d in input().split())
    C[A].append(B)
    C[B].append(A)

# BFS
Q = []
ungrouped = [i for i in range(1, N+1)]
G = []

while len(ungrouped) > 0:
    init = ungrouped.pop(0)
    Q += C[init]
    G.append([])
    G[-1].append(init)

    while len(Q) > 0:
        I = Q.pop(0)
        for J in C[I]:
            if J in ungrouped:
                Q.append(J)
        G[-1].append(I)
        ungrouped.remove(I)

print(max([len(g) for g in G]))



Fixed submission:
N, M = (int(d) for d in input().split())

C = [set() for i in range(N+1)]
for i in range(M):
    A, B = (int(d) for d in input().split())
    C[A].update([B])
    C[B].update([A])

# BFS
seen = set()
G = []

for i in range(1, N+1):
    if i in seen:
        continue

    # create new group
    G.append(set())

    # create queue
    Q = [i]
    G[-1].update(Q)
    seen.update(Q)

    while len(Q) > 0:
        # queue is not empty

        I = Q.pop(0)
        J = C[I].difference(seen)
        Q += list(J)
        G[-1].update(J)

        seen.update(J)

print(max([len(g) for g in G]))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = (int(d) for d in input().split())

C = [[] for i in range(N+1)]
for i in range(M):
    A, B = (int(d) for d in input().split())
    C[A].append(B)
    C[B].append(A)

# BFS
Q = []
ungrouped = [i for i in range(1, N+1)]
G = []

while len(ungrouped) > 0:
    init = ungrouped.pop(0)
    Q += C[init]
    G.append([])
    G[-1].append(init)

    while len(Q) > 0:
        I = Q.pop(0)
        if I in ungrouped:
            Q += C[I]
            G[-1].append(I)
            ungrouped.remove(I)

print(max([len(g) for g in G]))


Fixed submission:
N, M = (int(d) for d in input().split())

C = [set() for i in range(N+1)]
for i in range(M):
    A, B = (int(d) for d in input().split())
    C[A].update([B])
    C[B].update([A])

# BFS
seen = set()
G = []

for i in range(1, N+1):
    if i in seen:
        continue

    # create new group
    G.append(set())

    # create queue
    Q = [i]
    G[-1].update(Q)
    seen.update(Q)

    while len(Q) > 0:
        # queue is not empty

        I = Q.pop(0)
        J = C[I].difference(seen)
        Q += list(J)
        G[-1].update(J)

        seen.update(J)

print(max([len(g) for g in G]))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

A = np.array([int(i) for i in input().split()])
A_sort = np.sort(A)

#print(A_sort)
score = 0
score += A_sort[-1]
for i in range(0, (N-2)//2):
    score += A_sort[-2-i] * 2
    
if (N-2) % 2 == 1:
    score += A_sort[-3-i]
    
print(score)


Fixed submission:
N = int(input())

print((1000 - (N % 1000)) % 1000)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
F = np.zeros(N+1, dtype=int)
K = np.arange(N+1, dtype=int)

for i in range(1,(N+1)//2+1):
    F[::i] += 1

F[(N+1)//2+1:] += 1

print(np.sum(K * F))

Fixed submission:
import numpy as np

N = int(input())

count = 0
for i in range(1, N+1):
    count += (N // i) * (i + i * (N//i)) // 2


print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
P = np.array(list(map(int, input().split())))

def get_the_i(P, n):
    return np.argmin(P[:n])

i = np.argmin(P)
count = 1
while(i > 0):
    i = get_the_i(P, i)
    count += 1
    
print(count)
    

Fixed submission:

import numpy as np
N = int(input())
P = np.array(list(map(int, input().split())))

MIN = P[0]
count = 1
for p in P[1:]:
    if p < MIN:
        count += 1
        MIN = p

print(count)
Buggy python submission (verdict: Runtime Error):
C = raw_input()
C_ord = ord(C)
print(chr(C_ord + 1))

Fixed submission:
C = ord(raw_input())
print(chr(C+1))

Buggy python submission (verdict: Runtime Error):
C = raw_input()
C_ord = ord(C)
print(str(C_ord+1))

Fixed submission:
C = ord(raw_input())
print(chr(C+1))
Buggy python submission (verdict: Runtime Error):

import numpy as np
N, K  = map(int, raw_input().split())
A = np.array(map(int, raw_input().split()))

A_cumsum = np.empty(N+1, dtype=int)
A_cumsum[0] = 0
A_cumsum[1:] = np.cumsum(A)
ans = 0
for i in xrange(1, K):
    seq_sum = A_cumsum[i:] - A_cumsum[:-i]
    ans += np.sum(seq_sum%K==1)
    
print ans

Fixed submission:
Day = {"SUN":7,
       "MON":6,
       "TUE":5,
       "WED":4,
       "THU":3,
       "FRI":2,
       "SAT":1}

S = raw_input()

print Day[S]

Buggy python submission (verdict: Runtime Error):
A, B, X = map(int, raw_input().split())

def price(i, A, B):
    Dig = len(str(i))
    return A * i + B * Dig

l = 0
r = 10**9 + 1

while (r-l) > 1:
    c = (r+l)/2
    Pri = price(c, A, B)
    if Pri <= X:
        l = c
    else:
        r = c

print l


Fixed submission:
Day = {"SUN":7,
       "MON":6,
       "TUE":5,
       "WED":4,
       "THU":3,
       "FRI":2,
       "SAT":1}

S = raw_input()

print Day[S]

Buggy python submission (verdict: Runtime Error):

A, B, X = map(int, raw_input().split())

def price(i, A, B):
    Dig = len(str(i))
    return A * i + B * Dig

l = 0
r = 10**9 + 1

while (r-l) > 1:
    c = (r+l)/2
    Pri = price(c, A, B)
    if Pri <= X:
        l = c
    else:
        r = c




Fixed submission:
Day = {"SUN":7,
       "MON":6,
       "TUE":5,
       "WED":4,
       "THU":3,
       "FRI":2,
       "SAT":1}

S = raw_input()

print Day[S]

Buggy python submission (verdict: Runtime Error):
Day = {"SUN":7,
       "MON":6,
       "TUE":5,
       "WEN":4,
       "THU":3,
       "FRI":2,
       "SAT":1}

S = raw_input()

print Day[S]

Fixed submission:
Day = {"SUN":7,
       "MON":6,
       "TUE":5,
       "WED":4,
       "THU":3,
       "FRI":2,
       "SAT":1}

S = raw_input()

print Day[S]
Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
S = raw_input
I = map(ord, S)
I_shifted = map(lambda x: x+N if x+N<91 else x+N-26, I)
print map(chr, I_shifted)

Fixed submission:
N = int(raw_input())
S = raw_input()
I = map(ord, S)
I_shifted = map(lambda x: x+N if x+N<91 else x+N-26, I)
print "".join(map(chr, I_shifted))
Buggy python submission (verdict: Runtime Error):

S  <>= raw_input()
SS = ">"+S+"<"
N = len(SS) - 1
A = [None for i in xrange(N)]

for i in xrange(N):
    if (SS[i] == ">" and SS[i+1] == "<"):
        A[i] = 0
        j = 0
        while (i-j-1)>=0 and SS[i-j] == ">":
            if A[i-j-1] == None:
                A[i-j-1] = j+1
            else:
                Max = max(A[i-j-1], j+1)
                A[i-j-1] = Max
            j += 1
        j = 0
        while (i+j+1)<N and SS[i+j+1] == "<":
            if A[i+j+1] == None:
                A[i+j+1] = j+1
            else:
                Max = max(A[i+j+1], j+1)
                A[i+j+1] = Max
            j += 1

print sum(A)            


Fixed submission:

S  = raw_input()
SS = ">"+S+"<"
N = len(SS) - 1
A = [None for i in xrange(N)]

for i in xrange(N):
    if (SS[i] == ">" and SS[i+1] == "<"):
        A[i] = 0
        j = 0
        while (i-j-1)>=0 and SS[i-j] == ">":
            if A[i-j-1] == None:
                A[i-j-1] = j+1
            else:
                Max = max(A[i-j-1], j+1)
                A[i-j-1] = Max
            j += 1
        j = 0
        while (i+j+1)<N and SS[i+j+1] == "<":
            if A[i+j+1] == None:
                A[i+j+1] = j+1
            else:
                Max = max(A[i+j+1], j+1)
                A[i+j+1] = Max
            j += 1

print sum(A)

Buggy python submission (verdict: Runtime Error):
SS = ">"+S+"<"
N = len(SS) - 1
A = [None for i in xrange(N)]

for i in xrange(N):
    if (SS[i] == ">" and SS[i+1] == "<"):
        A[i] = 0
        j = 0
        while (i-j-1)>=0 and SS[i-j] == ">":
            if A[i-j-1] == None:
                A[i-j-1] = j+1
            else:
                Max = max(A[i-j-1], j+1)
                A[i-j-1] = Max
            j += 1
        j = 0
        while (i+j+1)<N and SS[i+j+1] == "<":
            if A[i+j+1] == None:
                A[i+j+1] = j+1
            else:
                Max = max(A[i+j+1], j+1)
                A[i+j+1] = Max
            j += 1

print sum(A)   

Fixed submission:

S  = raw_input()
SS = ">"+S+"<"
N = len(SS) - 1
A = [None for i in xrange(N)]

for i in xrange(N):
    if (SS[i] == ">" and SS[i+1] == "<"):
        A[i] = 0
        j = 0
        while (i-j-1)>=0 and SS[i-j] == ">":
            if A[i-j-1] == None:
                A[i-j-1] = j+1
            else:
                Max = max(A[i-j-1], j+1)
                A[i-j-1] = Max
            j += 1
        j = 0
        while (i+j+1)<N and SS[i+j+1] == "<":
            if A[i+j+1] == None:
                A[i+j+1] = j+1
            else:
                Max = max(A[i+j+1], j+1)
                A[i+j+1] = Max
            j += 1

print sum(A)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = list(map(int, input().split()))

L_sorted = sorted(L)

def bis(left, right, SrcList, value):
    if SrcList[left] >= value:
        return -1 # no results
    elif SrcList[right] < value:
        return -2 # all results
    while (left + 1 < right):
        mid = (left + right) // 2
        if SrcList[mid] < value:
            left = mid
        else:
            right = mid
    return left


count = 0
for i in range(0, N-2):
    for j in range(i+1,N-1):
        r = bis(j+1, N-1, L_sorted, L_sorted[i] + L_sorted[j])
        if r == -1:
            pass
        elif r == -2:
            count += ((N-j) * (N-j-1))//2
            break
        else:
            count += r-j
        

print(count)

Fixed submission:
from bisect import bisect_right

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

L_sorted = sorted(L)

count = 0
for i in range(N):  # longest stick
    for j in range(i):  # second longest stick
        r = bisect_right(L_sorted, L_sorted[i] - L_sorted[j])
        count += max(0, j - r)

print(count)

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

L_sorted = sorted(L)

count = 0
for i in range(0, N):
    for j in range(i+1,N):
        for k in range(j+1, N):
            if L_sorted[i] + L_sorted[j] > L_sorted[k]:
                count += 1
            else:
                break

print(count)

Fixed submission:
from bisect import bisect_right

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

L_sorted = sorted(L)

count = 0
for i in range(N):  # longest stick
    for j in range(i):  # second longest stick
        r = bisect_right(L_sorted, L_sorted[i] - L_sorted[j])
        count += max(0, j - r)

print(count)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, raw_input().split())

divisor = []

for i in xrange(2, min(A,B)):
    if A % i == 0 and B % i == 0:
        divisor.append(i)
        A /= i
        B /= i
        while (A%i == 0) or (B%i == 0):
            A /= i
            B /= i
    
print len(divisor)+1

Fixed submission:
N = int(raw_input())

P = 1.0*((N-1)/2 +1) / N
print "{:12.10f}".format(P)