Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N,T  = list(map(int,input().split()))
d = int(T / N)
if T % N == 0:
    print (d)


else:
    for i in range(d+1,0,-1):    
        if T % i ==0:
            print(i)
            break
   

### FIXED CODE ###

N,T  = list(map(int,input().split()))
d = int(T / N)
def ans():
    for i in range(d+1,0,-1):    
            if T % i ==0:
                print(i)
                break
if T % N == 0:
    print (d)
else:
    ans()
### BUGGY CODE ###

import math

N = int(input())
lis_all = []
lis_pat = []
lis_num = []

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

count = 0
for i in range(N):
    lis_S = list(str(input()))
    lis_S.sort()
    if lis_S not in lis_all:
        lis_pat.append(lis_S)
    lis_all.append(lis_S)

for i in lis_pat:
    lis_num.append(lis_all.count(i))

ans = 0
for i in lis_num:
    if i != 1:
        ans += comb(i,2)
   
print(ans)
    

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
N=int(input())
dic={}
sum=0
for i in range(N):
    s=list(input())
    s.sort()
    s = "".join(s)
    if s in dic:
        sum+=dic[s]
        dic[s]+=1
    else:
        dic[s]=1
print(sum)
### BUGGY CODE ###

from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N,S=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353
sumA=sum(A)

dp=[defaultdict(int) for n in range(3001)]
for n in range(N):
    a=A[n]

    for s in range(max(0,S-sumA),S+1)[::-1]:
        if s+a<=S:
            for h in dp[s]:
                dp[s+a][h+1]+=dp[s][h]
    dp[a][1]+=1
    sumA-=a
c=0
for a in dp[S]:
    c+=pow(2,N-a,mod)*dp[S][a]
    c%=mod
print(c)


### FIXED CODE ###

from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N,S=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353

gyaku=pow(2,mod-2,mod)
N2=pow(2,N-1,mod)
dp=[[0,0] for n in range(3001)]
for n in range(N):
    a=A[n]
    for s in range(0,S+1)[::-1]:
        if s+a<=S:
            dp[s+a][1]+=dp[s][1]*gyaku%mod
            dp[s+a][1]%=mod
    dp[a][1]+=N2

print(dp[S][1])
#print(c)
### BUGGY CODE ###

n=int(input())
s_list=[]
u_list=[]
for i in range(n):
  s_elem=''.join(sorted(list(input())))
  s_list.append(s_elem)
  if s_list.count(s_elem) > 1:
    u_list.append(s_elem)

unq_list=list(set(u_list))
count=0

for j in range(len(unq_list)):
  match_n=s_list.count(unq_list[j])
  count+=sum(range(1, match_n))

print(count)

### FIXED CODE ###

n=int(input())
dic={}

count=0
for i in range(n):
  s_elem=''.join(sorted(list(input())))
  if s_elem in dic:
    count+=dic[s_elem]
    dic[s_elem]+=1
  else:
    dic[s_elem]=1

print(count)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N, X, Y, Z = map(int, input().split())
MOD = 10 ** 9 + 7

dp = [[0] * (1 << 18) for i in range(N + 1)]

ng = (1 << Z) + (1 << (Y + Z)) + (1 << (X + Y + Z))
S = (1 << (X + Y + Z + 1)) - 1
dp[0][1] = 1
for i in range(N):
    for j in range(S + 1):
        for k in range(1, 11):
            s = ((j << k) & S) + 1
            if s & ng == ng:
                continue
            dp[i + 1][s] += dp[i][j]
            dp[i + 1][s] %= MOD


ans = pow(10, N, MOD)
num = 0
for i in range(S):
    num += dp[N][i]
    num %= MOD

print((ans - num + MOD) % MOD)

### FIXED CODE ###

N, X, Y, Z = map(int, input().split())
MOD = 10 ** 9 + 7
ng = (1 << (Z - 1)) + (1 << (Y + Z - 1)) + (1 << (X + Y + Z - 1))
S = (1 << (X + Y + Z)) - 1

dp = [[0] * (S + 1) for i in range(N + 1)]

dp[0][0] = 1
for i in range(1, N + 1):
    for j in range(S + 1):
        for k in range(1, 11):
            s = ((j << k) | 1 << k - 1) & S
            if (s & ng) == ng:
                continue
            dp[i][s] += dp[i - 1][j]
            dp[i][s] %= MOD


ans = pow(10, N, MOD)
num = 0
for i in range(S + 1):
    num += dp[N][i]
    num %= MOD

print((ans - num + MOD) % MOD)
### BUGGY CODE ###

num_list = [int(i) for i in input().split()]
height_list = [int(i) for i in input().split()]
way_list = list(list(map(int, input().split())) for i in range(num_list[1]))
ans_cnt = 0
# 道がある塔を確認（道がない場合は無条件でgood）
check_tower_list = []
for i in way_list:
    check_tower_list += i
check_tower_set = set(check_tower_list)

good_tower = set(i+1 for i in range(len(height_list))) - check_tower_set
ans_cnt += len(good_tower)

# check_tower_setの塔のみbad_dictを作成
bad_dict = {tower_num:
            [v+1 for v in range(len(height_list)) if height_list[v] >= height_list[tower_num-1] and tower_num != v+1
            ] for tower_num in check_tower_set
           }

for tower_num in bad_dict.keys():
    check_way_list = []
    for way_val in way_list:
        if tower_num in way_val:
            check_way_list += way_val
        else:
            pass
        check_way_set = set(check_way_list)

    if len(check_way_set & set(bad_dict[tower_num])) == 0:
        ans_cnt += 1
    else:
        pass
print(ans_cnt)

### FIXED CODE ###

import collections
num_list = [int(i) for i in input().split()]
height_list = [int(i) for i in input().split()]
way_list = list(list(map(int, input().split())) for i in range(num_list[1]))

tower_list = [i for i in range(1, num_list[0]+1)]
gd_dict = dict(zip(tower_list, ['good' for i in range((len(tower_list)))]))

def change_to_bad(target_list):
    if height_list[target_list[0]-1] > height_list[target_list[1]-1]:
        gd_dict[target_list[1]] = 'bad'
    elif height_list[target_list[0]-1] == height_list[target_list[1]-1]:
        gd_dict[target_list[0]] = 'bad'
        gd_dict[target_list[1]] = 'bad'
    else:
        gd_dict[target_list[0]] = 'bad'

for i in way_list:
    change_to_bad(i)

good_val = collections.Counter(gd_dict.values())['good']

print(good_val)
### BUGGY CODE ###

import itertools

DIM = int(input())
args = [int(input()) for a in range(DIM)]
i = DIM
while(i>0):
    comb = list(itertools.combinations(args, i))
    combMax = list(map(sum, comb))
    for c in sorted(combMax, reverse=True):
        if c%10==0:
            continue
        else:
            print(c)
            exit()
    i = i -1
print(0)
exit()

### FIXED CODE ###

import itertools

DIM = int(input())
args = [int(input()) for a in range(DIM)]
temp = list(map(lambda x:x%10, args))
if sum(temp) == 0:
    print(0)
    exit()
i = DIM
while(i>0):
    comb = list(itertools.combinations(args, i))
    combMax = list(map(sum, comb))
    for c in sorted(combMax, reverse=True):
        if c%10==0:
            continue
        else:
            print(c)
            exit()
    i = i -1
print(0)
exit()
### BUGGY CODE ###

import sys,itertools
input = sys.stdin.readline
N = int(input().strip())
S = input().strip()

def isUnique(a):
    return len(a) == len(set(a))

master = []
for i in range(N):
    for j in itertools.combinations(S,i+1):
        if isUnique(j):
            master.append(j)
        else:
            continue

print(len(master)%((10**9)+7))

### FIXED CODE ###

import sys,itertools
input = sys.stdin.readline
N = int(input().strip())
S = input().strip()

le = [S.count(s)+1 for s in set(S)]
cnt=1
for i in le:
    cnt*=i
print((cnt-1)%((10**9)+7))
### BUGGY CODE ###

def main():
    import sys
    from collections import Counter
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    S = int(input())
    MOD = 10 ** 9 + 7
    if S < 3:
        print(0)
        return
    ans = 0
    fact = [1] * (S+1)
    inv_fact = [1] * (S+1)
    for i in range(1, S+1):
        fact[i] = (fact[i-1] * i) % MOD
    inv_fact[-1] = pow(fact[-1], MOD-2, MOD)
    for i in range(S - 1, -1, -1):
        inv_fact[i] = (inv_fact[i+1] * (i + 1)) % MOD

    # def nCr_mod(n, r, MOD):
    #     return fact[n] * inv_fact[n-r] * inv_fact[r] % MOD

    def dp(l, p, s):
        # if s == S:
        # print(l, p, s)
        if s == 0:
            ret = fact[len(l)]
            for i in Counter(l).values():
                ret *= inv_fact[i]
                ret %= MOD
            # print('count {}'.format(ret))
            return ret
        elif s < 3:
            # print('s = {}, return'.format(s))
            return 0

        l_ = l[:]
        ret = 0
        for i in range(min(p, s), 2, -1):
            l_ = l + [i]
            ret += dp(l_, i, s-i)
            ret %= MOD
        return ret

    print(dp([], S, S))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    from collections import Counter
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    S = int(input())
    MOD = 10 ** 9 + 7
    if S < 3:
        print(0)
        return
    a, b, c, ans = 0, 0, 0, 0
    for i in range(3, S):
        d = (a + 1) % MOD
        a = (a + b) % MOD
        b, c = c, d
    print((a + 1) % MOD)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

from __future__ import division, print_function

import sys
from atexit import register

if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream


sys.stdin = stream(sys.stdin.read())
input = lambda: sys.stdin.readline().rstrip('\r\n')

sys.stdout = stream()
register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

from collections import Counter

def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    n = read_int()
    A = read_ints()
    MAX = max(A)+1 # 10**6+1
    count = [Counter() for i in range(MAX)]
    modulo = 10**9+7
    # disassemble all numbers up to 10**6
    for number in range(2, MAX):
        if len(count[number]) > 0: # not prime
            continue
        for step in range(number, MAX, number):
            temp = number
            while step%temp == 0:
                count[step][number] += 1
                temp *= number
    max_counter = Counter()
    for a in A:
        for k, v in count[a].items():
            max_counter[k] = max(max_counter[k], v)
    answer = 0
    for a in A:
        B = 1
        for k, v in max_counter.items():
            B = (B*k**(v-count[a][k]))%modulo
        answer = (answer+B)%modulo
    return answer


if __name__ == '__main__':
    print(solve())


### FIXED CODE ###

import math
from typing import List, Counter, Tuple
from collections import Counter
from itertools import permutations, zip_longest, groupby


def read_int() -> int:
    return int(input().strip())


def read_ints() -> List[int]:
    return list(map(int, input().strip().split(' ')))

modulo = 10**9+7


def merge(A, start, end, divisors):
    if start == end:
        return Counter(divisors[A[start]])
    mid = start+(end-start)//2
    left = merge(A, start, mid, divisors)
    right = merge(A, mid+1, end, divisors)
    for r in right:
        left[r] = max(left[r], right[r])
    return left

def solve() -> int:
    N = read_int()
    A = read_ints()
    M = 10**6+1
    divisors: List[List[int]] = [[] for _ in range(M)]
    for i in range(2, M):
        if len(divisors[i]) == 0:
            for j in range(i, M, i):
                temp = j
                while temp%i == 0:
                    divisors[j].append(i)
                    temp //= i
    lcd_counter = merge(A, 0, N-1, divisors)
    lcd = 1
    for k in lcd_counter:
        lcd = (lcd*pow(k, lcd_counter[k], modulo))%modulo
    answer = 0
    for a in A:
        answer = (answer+(lcd*pow(a, modulo-2, modulo))%modulo)%modulo
    return answer


if __name__ == '__main__':
    print(solve())
### BUGGY CODE ###

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

ans=''

for i in range(1,N+1):
    a=Ai.index(i)+1
    ans+=(str(a)+' ')

print(ans)

### FIXED CODE ###

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

# ans=[]
ans=[0]*N

# for i in range(1,N+1):
    # a=Ai.index(i)+1
    # ans.append(str(a))
for i in range (N):
    ans[Ai[i]-1]=str(i+1)

print(' '.join(ans))
### BUGGY CODE ###

#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, A: "List[int]"):
    ans = 1
    for a in A:
        ans *= a
    return -1 if ans > 10**18 else ans


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, A))


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, A: "List[int]"):
    if min(A) == 0:
        return 0
    ans = 1
    for a in A:
        ans *= a
        if ans > 10**18:
            return -1
    return ans


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, A))


if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys
input = sys.stdin.readline
import math
from collections import defaultdict

n = map(int, input())
a = list(map(int, input().split()))
N = 1000005
b = [0] * N

d = defaultdict(int)
for x in a:
    d[x] += 1

for x in d:
    for j in list(range(2, N)):
        if x * j >= N:
            break
        else:
            b[x * j] = 1

ans = 0
for x in a:
    if b[x] == 1:
        continue
    else:
        if d[x] >= 2:
            continue
        else:
            ans += 1
print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
import math

n = map(int, input())
a = list(map(int, input().split()))
N = 1000005
b = [0] * N

for x in a:
    if b[x] == 0:
        for y in list(range(2 * x, N, x)):
            b[y] += 1
    b[x] += 1

ans = 0
for x in a:
    if b[x] == 1:
        ans += 1
print(ans)
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(n-1):
    for j in range(i+1, n):
        ans += A[i]*A[j]
        ans %= 1000000007

print(ans)

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
ans = 0
total = sum(A[1:])

for i in range(n-1):
    ans += A[i]*total
    total -= A[i+1]
    ans %= 1000000007

print(ans)
### BUGGY CODE ###

# import math
# import statistics
# a=input()
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(i)
e1,e2 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]
h = []
for i in range(e2):
    h.append(list(map(int,input().split())))

ans=[]

for i in range(1,e1+1):
    count=0
    for k in range(e2):
        if h[k][0]<=i<=h[k][1]:
            count+=1
    if count==e2:
        ans.append(count)

print(len(ans))
    





### FIXED CODE ###

# import math
# import statistics
# a=input()
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(i)
e1,e2 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]
h = []
for i in range(e2):
    h.append(list(map(int,input().split())))
L=[]
R=[]
for i in range(len(h)):
    L.append(h[i][0])
for i in range(len(h)):
    R.append(h[i][1])

if min(R)>=max(L):
    print(min(R)-max(L)+1)
else:
    print(0)
### BUGGY CODE ###

from copy import copy
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
d = Counter(a)

#print(d)
for i in range(1, n):
    one = prev = a[0]
    two = cur = a[i]
    dd = copy(d)
    end = True
    for j in range(n-2):
        nxt = prev^cur
        if dd[nxt] >0:
            dd[nxt] -= 1
        else:
            end = False
            break
        prev = cur
        cur = nxt
    if end and prev^cur == one and dd[one] > 0 and cur^one == two and dd[two] > 0:
        print("Yes")
        exit()
print("No")

### FIXED CODE ###

from collections import Counter
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
if (len(c) == 1 and c[0] == n) or (len(c) == 2 and c[0] == n//3 and c[max(c.keys())] == 2*n//3) or (len(c) == 3 and reduce(lambda x, y: x^y, c.keys()) == 0 and set(c.values()) == set([n//3])):
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

def is_good(mid, key):
    return sum(count_cuts(a, mid) for a in A) <= key


def binary_search(key):
    bad, good = 0, 10 ** 16
    while good - bad > 1:
        mid = (bad + good) // 2
        if is_good(mid, key):
            good = mid
        else:
            bad = mid
    return good


def count_cuts(a, unit):
    return (a + unit - 1) // unit - 1


N, K, *A = map(int, open(0).read().split())
print(binary_search(K))


### FIXED CODE ###

def is_good(mid, key):
    return sum(count_cuts(a, mid) for a in A) <= key


def binary_search(key):
    bad, good = 0, 2 * 10 ** 14 + 1
    while good - bad > 1:
        mid = (bad + good) // 2
        if is_good(mid, key):
            good = mid
        else:
            bad = mid
    return good


def count_cuts(a, unit):
    return (a + unit - 1) // unit - 1


N, K, *A = map(int, open(0).read().split())
print(binary_search(K))
### BUGGY CODE ###

from collections import defaultdict
def main():
    N, Q = map(int, input().split())

    # tree = [[] for _ in range(N)]
    tree = defaultdict(list)

    for _ in range(N-1):
        a,b = map(int, input().split())
        a -= 1
        b -= 1
        tree[a].append(b)

    for i in range(N-1,-1,-1):
        if tree[i]:
            for j in tree[i]:
                if tree[j]:
                    for k in tree[j]:
                        tree[i].append(k)
    
    ans = [0] * N

    for _ in range(Q):
        p, x = map(int, input().split())
        p -= 1
        ans[p] += x
        for i in tree[p]:
            ans[i] += x

    print(*ans)


main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

def dfs(v, p, tree, ans):
    for u in tree[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v, tree, ans)

def main():
    N, Q = map(int, input().split())
    tree = [[] for _ in range(N)]
    for i in range(N - 1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        tree[a].append(b)
        tree[b].append(a)
    ans = [0] * N
    for i in range(Q):
        p, x = map(int, input().split())
        p -= 1
        ans[p] += x

    dfs(0, -1, tree, ans)

    print(*ans)

main()
### BUGGY CODE ###

def main():
    h, w = map(int, input().split())
    s = [tuple(input()) for _ in range(h)]
    L = [[0] * w for _ in range(h)]
    R = [[0] * w for _ in range(h)]
    U = [[0] * w for _ in range(h)]
    D = [[0] * w for _ in range(h)]
    ans = 0
    for i in range(h):
        for j in range(w):
            if j != 0:
                L[i][j] = L[i][j - 1]
            if s[i][j] == ".":
                L[i][j] += 1
            else:
                L[i][j] = 0
    for i in range(h):
        for j in range(w - 1, -1, -1):
            if j != w - 1:
                R[i][j] = R[i][j + 1]
            if s[i][j] == ".":
                R[i][j] += 1
            else:
                R[i][j] = 0
    for j in range(w):
        for i in range(h):
            if i != 0:
                U[i][j] = U[i - 1][j]
            if s[i][j] == ".":
                U[i][j] += 1
            else:
                U[i][j] = 0
    for j in range(w):
        for i in range(h - 1, -1, -1):
            if i != h - 1:
                D[i][j] = D[i + 1][j]
            if s[i][j] == ".":
                D[i][j] += 1
            else:
                D[i][j] = 0
    for i in range(h):
        for j in range(w):
            if s[i][j] == ".":
                ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

h, w = map(int, input().split())
s = [input() for _ in range(h)]
L = [[0] * w for _ in range(h)]
R = [[0] * w for _ in range(h)]
U = [[0] * w for _ in range(h)]
D = [[0] * w for _ in range(h)]
ans = 0
for i in range(h):
    for j in range(w):
        if j != 0:
            L[i][j] = L[i][j - 1]
        if s[i][j] == ".":
            L[i][j] += 1
        else:
            L[i][j] = 0
for i in range(h):
    for j in range(w - 1, -1, -1):
        if j != w - 1:
            R[i][j] = R[i][j + 1]
        if s[i][j] == ".":
            R[i][j] += 1
        else:
            R[i][j] = 0
for j in range(w):
    for i in range(h):
        if i != 0:
            U[i][j] = U[i - 1][j]
        if s[i][j] == ".":
            U[i][j] += 1
        else:
            U[i][j] = 0
for j in range(w):
    for i in range(h - 1, -1, -1):
        if i != h - 1:
            D[i][j] = D[i + 1][j]
        if s[i][j] == ".":
            D[i][j] += 1
        else:
            D[i][j] = 0
for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)
print(ans)
### BUGGY CODE ###

n,w=map(int,input().split())
goods=[list(map(int,input().split())) for _ in range(n)]
DP=[[0]*(w+1) for _ in range(n+1)]
for i in list(range(n))[::-1]:
  wi,vi=goods[i][0],goods[i][1]
  for j in range(w+1):
    if j<wi:
      DP[i][j]=DP[i+1][j]
    else:
      DP[i][j]=max(DP[i+1][j],DP[i+1][j-wi]+vi)
print(DP[0][w])

### FIXED CODE ###

n,w=map(int,input().split())
goods=[list(map(int,input().split())) for _ in range(n)]
DP=[[0]*(w+1) for _ in range(n+1)]
for i in list(range(n))[::-1]:
  wi,vi=goods[i][0],goods[i][1]
  for j in range(w+1):
    if j<wi:
      DP[i][j]=DP[i+1][j]
    else:
      DP[i][j]=max(DP[i+1][j],DP[i+1][j-wi]+vi)
print(DP[0][w])
### BUGGY CODE ###

import bisect
def find_lt(a, x):
    'Find rightmost index less than x'
    i = bisect.bisect_left(a, x)
    if i:
        return i-1
    # raise ValueError
    return -1

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

count=0
for i,a in enumerate(L[:-2]):
    for  j,b in enumerate(L[i+1:-1]):
        minInd=i+1+j+1
        ind=find_lt(L[minInd:], a+b)
        count+=ind+1
print(count)

### FIXED CODE ###

import bisect
 
N = int(input())
L = list(map(int, input().split()))
L.sort()
 
c = 0
for i in range(N-2):
  for j in range(i+1, N-1):
    c += bisect.bisect_right(L, L[i]+L[j]-1) - j - 1
 
 
print(c)
### BUGGY CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))

r = [[0 for _ in range(n)] for _ in range(k)]

for i in range(k):
    for j in range(n):
        if j-a[j] < 0 and j+a[j]+1 <= (n-1):
            r[i][0] += 1
            r[i][j+a[j]+1] -= 1           
        elif j-a[j] < 0 and j+a[j]+1 > (n-1):
            r[i][0] += 1
        elif j-a[j] >=0 and j+a[j]+1 <= (n-1):
            r[i][j-a[j]] += 1
            r[i][j+a[j]+1] -= 1
        elif j-a[j] >= 0 and j+a[j]+1 > (n-1):
            r[i][j-a[j]] += 1
        else:
            r[i][j-a[j]] += 1
            r[i][j+a[j]+1] -= 1
    for j in range(1, n):
        r[i][j] += r[i][j-1]
    a = r[i]
    if r[i] == r[i-1]:
        print(' '.join(map(str, r[i])))
        exit()
print(' '.join(map(str, r[k-1])))


### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))


for i in range(k):
    b = [0] * (n+1)
    for j in range(n):
        l = max(0, j-a[j])
        r = min(n, j+a[j]+1)
        b[l] += 1
        b[r] -= 1
    for j in range(n):
        b[j+1] += b[j]
    b.pop()
    if a == b:
        break
    a = b
print(' '.join(map(str, a)))