Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

count = 1
for i in range(1, N):
    for j in range(i):
        if P[j] < P[i]:
            break
    else:
        count = count + 1

print(count)

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

count = 1
minP = P[0]
for i in range(1, N):
    if P[i] < minP:
        count = count + 1
        minP = P[i]

print(count)

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

count = 1
for i in range(1, N):
    for j in range(i):
        if P[j] < P[i]:
            break
    else:
        count = count + 1

print(count)

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

count = 1
minP = P[0]
for i in range(1, N):
    if P[i] < minP:
        count = count + 1
        minP = P[i]

print(count)
Buggy python submission (verdict: Runtime Error):
import fractions

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

a = A[0]
for i in range(1, N):
    g = a * A[i] // fractions.gcd(a, A[i])
    a = g
    
b = 0
for i in range(N):
    b = b + g // A[i]

c = b % (1000000007)
print(c)

Fixed submission:
import fractions

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

a = 1
for i in range(N):
    g = a * A[i] // fractions.gcd(a, A[i])
    a = g
    
b = 0
for i in range(N):
    b = b + g // A[i]

c = b % (1000000007)
print(c)

Buggy python submission (verdict: Runtime Error):
import fractions

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

a = A[0]
for i in range(1, N):
    gcc = a * A[i] // fractions.gcd(a, A[i])
    a = gcc
    
b = 0
for i in range(N):
    b = b + gcc // A[i]

c = b % (1000000007)
print(c)

Fixed submission:
import fractions

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

a = 1
for i in range(N):
    g = a * A[i] // fractions.gcd(a, A[i])
    a = g
    
b = 0
for i in range(N):
    b = b + g // A[i]

c = b % (1000000007)
print(c)

Buggy python submission (verdict: Runtime Error):
import fractions

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

a = A[0]
for i in range(1, N):
    gcc = a * A[i] // fractions.gcd(a, A[i])
    a = gcc
    
b = 0
for i in range(N):
    b = b + gcc // A[i]

c = b % (1000000007)
print(c)

Fixed submission:
import fractions

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

a = 1
for i in range(N):
    g = a * A[i] // fractions.gcd(a, A[i])
    a = g
    
b = 0
for i in range(N):
    b = b + g // A[i]

c = b % (1000000007)
print(c)

Buggy python submission (verdict: Runtime Error):
import fractions

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

a = A[0]
for i in range(1, N):
    gcc = a * A[i] // fractions.gcd(a, A[i])
    a = gcc
    
b = 0
for i in range(N):
    b = b + gcc // A[i]

c = b % (1000000000 + 7)
print(c)

Fixed submission:
import fractions

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

a = 1
for i in range(N):
    g = a * A[i] // fractions.gcd(a, A[i])
    a = g
    
b = 0
for i in range(N):
    b = b + g // A[i]

c = b % (1000000007)
print(c)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
p = []
S = []
for i in range(M):
    pp, SS = map(str, input().split())
    p.append(pp)
    S.append(SS)

a = []
for i in range(M):
    a.append(int(p[i]))

AC = 0
P = 0

Q = []
R = []
for i in range(N):
    Q.append(0)
    R.append(0)

for i in range(M):
    index = a[i] - 1
    if Q[index] == 0 and S[i] == 'AC':
        AC = AC + 1
        Q[index] = 1
    elif Q[index] == 0 and S[i] == 'WA':
        R[i - 1] = R[i - 1] + 1

for i in range(N):
    if Q[i] == 0:
        P = 0
    else: P = P + R[i]

print(AC, P)

Fixed submission:
N, M = map(int, input().split())
p = []
S = []
for i in range(M):
    pp, SS = map(str, input().split())
    p.append(pp)
    S.append(SS)

a = []
for i in range(M):
    a.append(int(p[i]))

AC = 0
P = 0

Q = []
R = []
for i in range(N):
    Q.append(0)
    R.append(0)

for i in range(M):
    index = a[i] - 1
    if Q[index] == 0 and S[i] == 'AC':
        AC = AC + 1
        Q[index] = 1
    elif Q[index] == 0 and S[i] == 'WA':
        R[a[i] - 1] = R[a[i] - 1] + 1

for i in range(N):
    if Q[i] == 0:
        P = P
    else: P = P + R[i]

print(AC, P)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
p = []
S = []
for i in range(M):
    pp, SS = map(str, input().split())
    p.append(pp)
    S.append(SS)

a = []
for i in range(M):
    a.append(int(p[i]))

AC = 0
P = 0

Q = []
R = []
for i in range(N):
    Q.append(0)
    R.append(0)

for i in range(M):
    index = a[i] - 1
    if Q[index] == 0 and S[i] == 'AC':
        AC = AC + 1
        Q[index] = 1
    elif Q[index] == 0 and S[i] == 'WA':
        R[i] = R[i] + 1

for i in range(N):
    if Q[i] == 0:
        P = 0
    else: P = P + R[i]

print(AC, P)

Fixed submission:
N, M = map(int, input().split())
p = []
S = []
for i in range(M):
    pp, SS = map(str, input().split())
    p.append(pp)
    S.append(SS)

a = []
for i in range(M):
    a.append(int(p[i]))

AC = 0
P = 0

Q = []
R = []
for i in range(N):
    Q.append(0)
    R.append(0)

for i in range(M):
    index = a[i] - 1
    if Q[index] == 0 and S[i] == 'AC':
        AC = AC + 1
        Q[index] = 1
    elif Q[index] == 0 and S[i] == 'WA':
        R[a[i] - 1] = R[a[i] - 1] + 1

for i in range(N):
    if Q[i] == 0:
        P = P
    else: P = P + R[i]

print(AC, P)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ps = list(map(int,input().split()))
count = 1
x = ps[0]
for i in range(1,len(ps)):
    if x>ps[i]:
        x = ps[i]
        mi = min(ps[0:i])
        if mi>ps[i]:
            count += 1
print(count)

Fixed submission:
n = int(input())
ps = list(map(int,input().split()))
count = 1
mi = ps[0]
for i in range(1,len(ps)):
    if mi>=ps[i]:
        mi = ps[i]
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ps = list(map(int,input().split()))
count = 1
for i in range(len(ps)):
    if i != 0:
        x = ps[i]
        mi = min(ps[0:i])
        if mi>ps[i]:
            count += 1
print(count)

Fixed submission:
n = int(input())
ps = list(map(int,input().split()))
count = 1
mi = ps[0]
for i in range(1,len(ps)):
    if mi>=ps[i]:
        mi = ps[i]
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
ans = int(a*b/math.gcd(a,b))
print(ans)

Fixed submission:
import fractions
a,b=map(int,input().split())
ans = a*b//fractions.gcd(a,b)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
ans = a*b//(math.gcd(a,b))
print(ans)

Fixed submission:
import fractions
a,b=map(int,input().split())
ans = a*b//fractions.gcd(a,b)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
ans = a*b//math.gcd(a,b)
print(ans)

Fixed submission:
import fractions
a,b=map(int,input().split())
ans = a*b//fractions.gcd(a,b)
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
def kyori(x1,y1,x2,y2):
    dis = ((x1-x2)**2+(y1-y2)**2)**0.5
    return dis
N = int(input())
xy = []
for n in range(N):
    xy.append(list(map(int, input().split())))
diss = np.zeros(N)
for i in range(N-1):
    for j in range(i+1,N):
        diss[i+j-1] = kyori(xy[i][0],xy[i][1],xy[j][0],xy[j][1])
print(np.average(np.sum(diss) - diss))

Fixed submission:
# coding: utf-8
# Your code here!
import numpy as np
import itertools
def kyori(x1,y1,x2,y2):
    dis = ((x1-x2)**2+(y1-y2)**2)**0.5
    return dis
N = int(input())
xy = []
for n in range(N):
    xy.append(list(map(int, input().split())))
diss = np.zeros((N,N))
c = list(itertools.permutations(range(N), N))
s = 0
for n in range(len(c)):
    for d in range(N-1):
        if diss[c[n][d]][c[n][d+1]]==0:
            diss[c[n][d]][c[n][d+1]] = kyori(xy[c[n][d]][0],xy[c[n][d]][1],xy[c[n][d+1]][0],xy[c[n][d+1]][1])
            diss[c[n][d+1]][c[n][d]] = diss[c[n][d]][c[n][d+1]]
        s += diss[c[n][d]][c[n][d+1]]
print(s/len(c))
Buggy python submission (verdict: Runtime Error):
import re
s = input()
ss = re.findall(r">+|<+",s,re.S)
count = 0
num = 0
if re.findall(">",ss[0],re.S):
    count += sum(range(len(ss[0])+1))
    del ss[0]
if re.findall("<",ss[-1],re.S):
    count += sum(range(len(ss[-1])+1))
    del ss[-1]
for i in range(len(ss)-1):
    if num == 0:
        num = max(len(ss[i]),len(ss[i+1]))
        count += sum(range(max(len(ss[i]),len(ss[i+1]))+1))
        count += sum(range(min(len(ss[i]),len(ss[i+1]))))
    else:
        num = 0
print(count)

Fixed submission:
import re
s = input()
ss = re.findall(r">+|<+",s,re.S)
count = 0
num = 0
if re.findall(">",ss[0],re.S):
    count += sum(range(len(ss[0])+1))
    del ss[0]
if ss and re.findall("<",ss[-1],re.S):
    count += sum(range(len(ss[-1])+1))
    del ss[-1]
for i in range(len(ss)-1):
    if num == 0:
        num = max(len(ss[i]),len(ss[i+1]))
        count += sum(range(max(len(ss[i]),len(ss[i+1]))+1))
        count += sum(range(min(len(ss[i]),len(ss[i+1]))))
    else:
        num = 0
print(count)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
prime1 = get_prime(A)
prime2 = get_prime(B)
ans_prime = prime1 & prime2
print(len(ans_prime) + 1)

def get_prime(n):
    prime = []
    while n % 2 == 0:
        prime.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime.append(n)
    return prime

Fixed submission:
def get_prime(n):
    prime = []
    while n % 2 == 0:
        prime.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime.append(n)
    return prime

A, B = map(int, input().split())
prime1 = get_prime(A)
prime2 = get_prime(B)
ans_prime = set(prime1) & set(prime2)
print(len(ans_prime) + 1)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
from collections import deque
import math 
n,m = map(int,input().split())
a = sorted(deque(map(int, input().split())))
for i in range(m):
    p = a.pop()
    p = math.floor(p/2)
    index = bisect.bisect_left(a,p)
    a.insert(index,p)
print(sum(a))

Fixed submission:
import heapq 
import math 
n,m = map(int,input().split())
a = list(map(lambda x:int(x)*(-1), input().split()))
heapq.heapify(a)
for i in range(m):
    p = heapq.heappop(a)
    p = math.ceil(p/2)
    heapq.heappush(a,p)
print(sum(a)*(-1))
Buggy python submission (verdict: Runtime Error):
K = int(input())
X = int(input())
print ('Yes' if 500 * K => X else 'No')

Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K,X=int(input( ))
print ('Yes' if 500 * K => X else 'No')

Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K,X=map(int,input( ).split( ))
print ('Yes' if 500 * K => X else 'No')


Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split())
a = 500 * K
if (a => X):
    print ('Yes')
else:
    print ('No')


Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split())
a = 500 * K
if a => X:
    print ('Yes')
else:
    print ('No')

Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split())
a = 500 * K
print ('Yes' if a => X else 'No')

Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split())
a = 500 * K
print ('Yes' if a => X else 'No')

Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K,X=map(int,input().split())
print ('Yes' if 500 * K =< X else 'No')

Fixed submission:
a = input().split()
K = int(a[0])
X = int(a[1])
if 500 * K >= X:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
if(a[0] == a[1])
	print('Yes')
else:
  print('No')

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

if a[0] == a[1]:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n, m = input().split()

if n = m:
  print('Yes')
else:
  print('No')

Fixed submission:
n, m = input().split()

if n == m:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n, m = input().split()

if n = m:
  return 'Yes'
else:
  return 'No'

Fixed submission:
n, m = input().split()

if n == m:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
print(chr(ord(C) + 1))

Fixed submission:
print(chr(ord(input()) + 1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))

c = [True for i in range(n)]
for i in range(1,n):
  p[0:i].sort()
  if p[i]>p[i-1]:
      c[i] = False
print(sum(c))

Fixed submission:
nm = list(map(int, input().split()))
if nm[0]==nm[1]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))

c = [True for i in range(n)]
for i in range(1,n):
  for j in range(i):
    if p[i]>p[j]:
      c[i] = False
      break
print(sum(c))

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

c = [True for i in range(n)]
target = p[0]
for i in range(1,n):
  if p[i]>target:
      c[i] = False
  else:
    target = p[i]
print(sum(c))

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

P_list = input().split()

P_list_int = [int(p) for p in P_list]


correct_cnt = 0
for i in range(N):
    for j in range(i+1):
        if(P_list_int[i]>P_list_int[j]):
            break

        if(j == i):
            correct_cnt += 1

print(correct_cnt)

Fixed submission:
N = int(input())

P_list = input().split()

P_list_int = [int(p) for p in P_list]


correct_cnt = 0
min_val = 200000
for i in range(N):
    if(P_list_int[i] <= min_val):
        min_val = P_list_int[i]
        correct_cnt += 1

print(correct_cnt)
Buggy python submission (verdict: Runtime Error):
def weather_prediction():
    today = input()
    print(tomorrow_weather_q today)

def tomorrow_weather_q(today):
    if today == "Sunny":
        return "Cloudy"
    elif today == "Cloudy":
        return "Rainy"
    elif today == "Rainy":
        return "Sunny"
    else:
        return 0

weather_prediction()
    


Fixed submission:
def weather_prediction():
    today = input()
    print(tomorrow_weather_q(today))

def tomorrow_weather_q(today):
    if today == "Sunny":
        return "Cloudy"
    elif today == "Cloudy":
        return "Rainy"
    elif today == "Rainy":
        return "Sunny"
    else:
        return 0

weather_prediction()
Buggy python submission (verdict: Runtime Error):
import numpy as np
import fractions
import sys
input = sys.stdin.readline


def f(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = np.array(A) // 2

    t = f(A[0])
    for i in range(len(A)):
        if f(A[i]) != t:
            print(0)
            return 0
        A[i] >>= t
    M >>= t

    l = 1
    for i in range(N):
        l = lcm(l, A[i])
        if l > M:
            print(0)
            return 0

    M /= l
    ans = (M + 1) // 2
    print(int(ans))


if __name__ == "__main__":
    main()


Fixed submission:
import fractions
import sys
input = sys.stdin.readline


def f(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = list(map(lambda x: x // 2, A))

    t = f(A[0])
    for i in range(len(A)):
        if f(A[i]) != t:
            print(0)
            return 0
        A[i] >>= t
    M >>= t

    l = 1
    for i in range(N):
        l = lcm(l, A[i])
        if l > M:
            print(0)
            return 0

    M /= l
    ans = (M + 1) // 2
    print(int(ans))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import fractions
import sys
input = sys.stdin.readline


def f(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = np.array(A) // 2

    t = f(A[0])
    for i in range(len(A)):
        if f(A[i]) != t:
            print(0)
            return 0
        A[i] >>= t
    M >>= t

    l = 1
    for i in range(N):
        l = lcm(l, A[i])
        if l > M:
            print(0)
            return 0

    M /= l
    ans = (M + 1) // 2
    print(int(ans))


if __name__ == "__main__":
    main()


Fixed submission:
import fractions
import sys
input = sys.stdin.readline


def f(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = list(map(lambda x: x // 2, A))

    t = f(A[0])
    for i in range(len(A)):
        if f(A[i]) != t:
            print(0)
            return 0
        A[i] >>= t
    M >>= t

    l = 1
    for i in range(N):
        l = lcm(l, A[i])
        if l > M:
            print(0)
            return 0

    M /= l
    ans = (M + 1) // 2
    print(int(ans))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math
import sys
input = sys.stdin.readline


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


def main():
    A, B = map(int, input().split())

    print(lcm(A, B))


if __name__ == "__main__":
    main()


Fixed submission:
import fractions
import sys
input = sys.stdin.readline


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def main():
    A, B = map(int, input().split())

    print(lcm(A, B))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())


if x <= a**2 * b / 2:
    print(math.degrees(math.atan(a * b**2 / 2 * x)))
else:
    print(math.degrees(math.atan(2(a**2 * b - x) / a**3)))


Fixed submission:
import math
a, b, x = map(float, input().split())


if x <= (a**2 * b) / 2:
    print(math.degrees(math.atan(a * b**2 / (2 * x))))
else:
    print(math.degrees(math.atan(2 * (a**2 * b - x) / a**3)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [int(i) for i in input().split()]

L = sorted(L, reverse=True)
ans = 0

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            if L[i] < L[j] + L[k]:
                ans += 1
            else:
                break

print(ans)


Fixed submission:
import bisect
N = int(input())
L = [int(i) for i in input().split()]

SL = sorted(L)
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        right = bisect.bisect_left(SL, SL[i] + SL[j])
        left = j + 1
        ans += right - left

print(ans)

Buggy python submission (verdict: Runtime Error):
import bisect
N = int(input())
L = [int(i) for i in input().split()]

SL = sorted(L)
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        right = bisect.bisect_left(SL, SL[i] + SL[j])
        left = j + 1
        ans += max(right - left)

print(ans)


Fixed submission:
import bisect
N = int(input())
L = [int(i) for i in input().split()]

SL = sorted(L)
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        right = bisect.bisect_left(SL, SL[i] + SL[j])
        left = j + 1
        ans += right - left

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [int(i) for i in input().split()]

L = sorted(L, reverse=True)
ans = 0

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            if L[i] < L[j] + L[k]:
                ans += 1
            else:
                break

print(ans)


Fixed submission:
import bisect
N = int(input())
L = [int(i) for i in input().split()]

SL = sorted(L)
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        right = bisect.bisect_left(SL, SL[i] + SL[j])
        left = j + 1
        ans += right - left

print(ans)

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

L = sorted(L, reverse=True)
ans = 0

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            if L[i] < L[j] + L[k]:
                ans += 1
            else:
                break

print(ans)


# for i in range(N - 2):
#     if L[i] < L[i + 1] + L[i + 2] and L[i + 1] < L[i + 2] + \
#             L[i] and L[i + 2] < L[i] + L[i + 1]:
#         ans += 1

# print(ans)


Fixed submission:
import bisect
N = int(input())
L = [int(i) for i in input().split()]

SL = sorted(L)
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        right = bisect.bisect_left(SL, SL[i] + SL[j])
        left = j + 1
        ans += right - left

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

ans = N
for i in range(N):
    cnt = 0
    for j in range(N):
        if i < j and S[j] == 'E':
            cnt += 1
        if i > j and S[j] == 'W':
            cnt += 1
    if cnt < ans:
        ans = cnt

print(ans)


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

cnt = S.count('E')
if S[0] == 'E':
    cnt -= 1
ans = cnt
for i in range(1, N):
    if S[i] == 'E':
        cnt -= 1
    if S[i - 1] == 'W':
        cnt += 1
    if cnt < ans:
        ans = cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())


def time_memo(n):
    memo = [0]*(n+1)

    def _time(n):
        if n <= 0:
            return 0
        elif n == 1:
            return 1
        elif memo[n] != 0:
            return memo[n]
        else:
            memo[n] = _time(n-1)*n
            return memo[n]
    return _time(n)


print(time_memo(N) % (10 ^ 9+7))


Fixed submission:
N = int(input())

Ans = 1
for i in range(1, N+1):
    Ans *= i
    Ans %= (10**9+7)

print(Ans)

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


def time(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return time(n-1) * n


print(time(N) % (10 ^ 9+7))


Fixed submission:
N = int(input())

Ans = 1
for i in range(1, N+1):
    Ans *= i
    Ans %= (10**9+7)

print(Ans)

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


def time(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return time(n-1) * n


print(time(N))


Fixed submission:
N = int(input())

Ans = 1
for i in range(1, N+1):
    Ans *= i
    Ans %= (10**9+7)

print(Ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())

cnt = 0
for i in range(a, b + 1):
    if i % x == 0:
        cnt += 1

print(cnt)


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

if a % x == 0:
    ans = (b // x) - (a // x) + 1
else:
    ans = (b // x) - (a // x)


print(ans)