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

from sys import stdin
from itertools import permutations 
from time import sleep


def solve(nums):
    num_person, *caps = nums
    caps = caps + [0]
    #  (人数, 乗り物のキャパシティ) のタプルの配列
    cities = list(zip([num_person] + ([0] * (len(caps) - 1)), caps))
    time = 0

    # 最後の都市に全員が移動したら終了
    while cities[-1][0] < num_person:
        mov_nums = [min(*city) for i, city in enumerate(cities) if i < len(cities) - 1]
        for i, mov_num in enumerate(mov_nums):
            city = cities[i]
            next_city = cities[i + 1]
            cities[i] = (city[0] - mov_num, city[1])
            cities[i + 1] = (next_city[0] + mov_num, next_city[1])
        time = time + 1
    return time


def main():
    nums = [int(l) for l in stdin.readlines()]
    ans = solve(nums)
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

from sys import stdin
from math import ceil

#  def solve(nums):
    #  num_person, *caps = nums
    #  caps = caps + [0]
    #  #  (人数, 乗り物のキャパシティ) のタプルの配列
    #  cities = list(zip([num_person] + ([0] * (len(caps) - 1)), caps))
    #  time = 0

    #  # 最後の都市に全員が移動したら終了
    #  while cities[-1][0] < num_person:
        #  print('|'.join([str(n) for n, cap in cities[:-1]]))
        #  mov_nums = [min(*city) for city in cities[:-1]]
        #  for i, mov_num in enumerate(mov_nums):
            #  city = cities[i]
            #  next_city = cities[i + 1]
            #  cities[i] = (city[0] - mov_num, city[1])
            #  cities[i + 1] = (next_city[0] + mov_num, next_city[1])
        #  time = time + 1
    #  return time


def solve(nums):
    num_person, *caps = nums
    return 4 + ceil(num_person / min(*caps))


def main():
    nums = [int(l) for l in stdin.readlines()]
    ans = solve(nums)
    print(ans)

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

import sys
from collections import deque
from copy import copy

N,K = list(map(int, input().split()))
V = deque(list(map(int, input().split())))

max_value = 0

def calc_max_value(V, k, l, r):
    store = deque([])
    for i in range(l):
        if len(V)>0:
            store.append(V.popleft())
            continue
        else:
            break
    for i in range(r):
        if len(V)>0:
            store.append(V.pop())
            continue
        else:
            break
    store = deque(sorted(store))
    max_value = sum(store)
    for i in range(k-l-r):
        if len(store)>0:
            e = store.popleft()
            if e < 0:
                max_value -= e
            else:
                break
        else:
            break
    return max_value

    
for k in range(K+1):
    for l in range(K+1):
        for r in range(K+1-l):
            max_value = max(max_value, calc_max_value(copy(V), k, l, r))

print(max_value)


### FIXED CODE ###

import sys
from collections import deque
from copy import copy

N,K = list(map(int, input().split()))
V = deque(list(map(int, input().split())))

max_value = 0

def calc_max_value(V, K, k, l, r):
    store = deque([])
    for i in range(l):
        if len(V)>0:
            store.append(V.popleft())
            continue
        else:
            break
    for i in range(r):
        if len(V)>0:
            store.append(V.pop())
            continue
        else:
            break
    store = deque(sorted(store))
    for i in range(K-l-r):
        if len(store)>0:
            e = store.popleft()
            if e < 0:
                continue
            else:
                store.appendleft(e)
                break
        else:
            break
    max_value = sum(store)
    return max_value

    
for k in range(min(K+1,N+1)):
    for l in range(k+1):
        for r in range(k+1-l):
            max_value = max(max_value, calc_max_value(copy(V), K, k, l, r))

print(max_value)
### BUGGY CODE ###

N = int(input())
l = list(map(int,input().split(' ')))

i = 0
count = 0
while 1:
    for j in range(N-1,i,-1):
        if l[j-1] > l[j]:
            l[j-1],l[j] = l[j],l[j-1]
            count +=1
    i+=1
    if i == N-1: break

print(' '.join(list(map(str,l))))
print(count)



### FIXED CODE ###

N = int(input())
l = list(map(int,input().split(' ')))

i = 0
count = 0
flag =1
while flag :
    flag = 0
    for j in range(N-1,i,-1):
        if l[j-1] > l[j]:
            l[j-1],l[j] = l[j],l[j-1]
            count +=1
            flag =1
    i+=1

print(' '.join(list(map(str,l))))
print(count)
### BUGGY CODE ###

l = list(map(int,input().split()))

for i in range(l[2]):
  if l[0] >= 1:
    l[0] = l[0] - 1
  else:
    if l[1] >= 1:
      l[1] = l[1] - 1
    else:
      break

print(str(l[0]) + " " + str(l[1])) 

### FIXED CODE ###

l = list(map(int,input().split()))

l[0] = l[0] - l[2]

if l[0] < 0:
  l[1] = l[1] + l[0]
  l[0] = 0
  if l[1] < 0:
    l[1] = 0

print(str(l[0]) + " " + str(l[1]))
### BUGGY CODE ###

import sys
from itertools import product


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    S = input()
    r = []
    g = []
    b = []
    for i in range(N):
        if S[i] == "R":
            r.append(i)
        elif S[i] == "G":
            g.append(i)
        else:
            b.append(i)
    A = product(r, g, b)
    ans = 0
    for a in A:
        a = list(a)
        a.sort()
        if a[2] - a[1] != a[1] - a[0]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import Counter


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    S = input()
    C = Counter(S)
    R = C.get("R", 0)
    G = C.get("G", 0)
    B = C.get("B", 0)
    ans = R * G * B
    for left in range(N):
        for mid in range(left + 1, N):
            right = mid + mid - left
            if right < N:
                if S[right] != S[mid] and S[mid] != S[left] and S[right] != S[left]:
                    ans -= 1
    print(ans)


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

# -*- coding: utf-8 -*-
# import numpy as np

N, M = map(int, input().split())
An = list(map(int, input().split()))

pare_list = []
val_list = []

for i in range(N):
    tmp = 0
    for j in range(i,N):
        tmp += An[j]
        pare_list.append((i,j))
        # for m in range(i,j+1):
        #     tmp += An[m]
        val_list.append(tmp)

count = 0
for val in val_list:
    if val % M == 0:
        count += 1


print(count)
# print(pare_list)
# print(val_list)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math

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

N, M = map(int, input().split())
An = list(map(int, input().split()))

Cn = [0]*(N+1)

for i,Ai in enumerate(An):
    if i == 0:
        Cn[i+1] = Ai
    else:
        Cn[i+1] = Cn[i] + Ai

# def func(n):
#     if n <= 1:
#         return 1
#     else:
#         tmp = 1
#         for i in range(2,n+1):
#             tmp = tmp * i
#         return tmp

mod = {}
for i in range(N+1):
    if Cn[i]%M in mod:
        mod[Cn[i]%M] += 1
    else:
        mod[Cn[i]%M] = 1

ans = 0
for val in mod.values():
    if val <= 1:
        continue
    elif val == 2:
        ans += 1
    else:
        # tmp = func(val) / (func(2) * func(val - 2))
        tmp = combinations_count(val,2)
        ans += int(tmp)

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

N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [0] * N

dp[0] = 0
for i in range(1, N):
    step = K+1 if K < i else i+1
    dp[i] = dp[i-1] + abs(h[i]-h[i-1])
    for j in range(2, step):
        dp[i] = min(dp[i], dp[i-j] + abs(h[i]-h[i-j]))
        
print(dp[N-1])


### FIXED CODE ###

N, K = map(int, input().split())
h = [int(i) for i in input().split()]

INF = float('inf')
dp = [INF] * N
dp[0] = 0
dp[1] = abs(h[1] - h[0])

for i in range(2, N):
    tmp = INF
    step = max(0, i-K)
    for j in range(step, i):
        tmp = min(tmp, dp[j] + abs(h[i] - h[j]))
    dp[i] = tmp

print(dp[N-1])
### BUGGY CODE ###

N, X = map(int, input().split())
x = list(map(lambda i: abs(int(i) - X), input().split()))

x_min = min(x)

for i in range(x_min, 0, -1):
    cnt = 0
    for j in x:
        if j % i != 0:
            break
        else:
            cnt += 1
    if cnt == N:
        print(i)
        exit()

### FIXED CODE ###

N, X = map(int, input().split())
x = list(map(lambda i: abs(int(i) - X), input().split()))

x_min = min(x)

for i in range(x_min, 0, -1):
    cnt = 0
    for j in x:
        if j % i != 0:
            break
        else:
            cnt += 1
    if cnt == N:
        print(i)
        exit()
### BUGGY CODE ###

h, n = map(int, input().split())

attack = []
magic = []
for i in range(n):
    a, b = map(int, input().split())
    attack.append(a)
    magic.append(b)

dp = [[float('inf') for _ in range(h+1)] for _ in range(n+1)]
dp[0][0] = 0
#print(attack, magic)
for i in range(n):
    for j in range(h+1):
        #print(max(dp[i][j], dp[i][j-attack[i]] + magic[i]))
        if dp[i+1][j] > dp[i][j]: dp[i+1][j] = dp[i][j]
        if dp[i+1][min(j+attack[i], h)] > dp[i+1][j]+magic[i]: dp[i+1][min(j+attack[i], h)] = dp[i+1][j]+magic[i]

print(dp[-1][-1])

### FIXED CODE ###

h, n = map(int, input().split())
magic = [tuple(map(int, input().split())) for _ in range(n)]
#magic = [list(map(int, input().split())) for _ in range(n)]

dp = [float('inf')] * (h+1)
dp[0] = 0

for i in range(h):
    for d, c in magic:
        next_index = min(i+d, h)
        dp[next_index] = min(dp[next_index], dp[i]+c)
        #print(d, c, dp)

print(dp[-1])
### BUGGY CODE ###

import numpy as np

N, K = map(int, input().split())
P = list(map(int, input().split()))
e = np.empty(N)

for i in range(N):
    e[i] = np.sum(np.arange(1, P[i]+1)) / P[i]

# !! not fast enough with native sliding window impl
# ret = np.sum(e[:K-1])
# curr = ret
# for i in range(K - 1, N):
#     curr += e[i]
#     ret = max(ret, curr)
#     curr -= e[i - K + 1]


# !! technically not an efficient sliding window
ret = 0
for i in range(N - K + 1):
    ret = max(ret, np.sum(e[i:i+K]))

print(ret)

### FIXED CODE ###

def main():
    N, K  = map(int, input().split())
    P = list(map(int, input().split()))
    best = sum(P[:K]) # sum of first K terms
    curr = best # tmp var for iteration
    for i in range(N - K):
        curr += P[i+K] - P[i] # slide window
        best = max(best, curr)
    print((best + K) / 2) # based on n(n+1)/2 == sum(range(1, n))

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

K,S=map(int,input().split())
ans=0
for X in range(0,K+1):
  for Y in range(0,K+1):
    for Z in range(0,K+1):
      if X+Y+Z==S:
        ans+=1
print(ans)


### FIXED CODE ###

K,S=map(int,input().split())
ans=0
for X in range(0,K+1):
  for Y in range(0,K+1):
    Z=S-X-Y
    if 0<=Z and Z<=K:
      ans+=1
print(ans)
### BUGGY CODE ###



MOD = 1000000007

def F(k, s):
    return dp[k][s]

def solve(n):
    resp = 0
    n = map(int, str(n))
    pref = 0
    for i in range(len(n)):
        for d in range(n[i]):
            resp += F(len(n) - i - 1, (pref - d) % D)
        pref -= n[i]
        pref %= D
    return resp


K = raw_input()
D = input()

# dp[i][j] = cant de numeros de i digitos con suma % d = j
dp = [[0] * D for _ in range(len(K) + 1)]
dp[0][0] = 1
for i in range(1, len(K) + 1):
    for j in range(D):
        for d in range(10):
            dp[i][j] += dp[i - 1][(j - d) % D]

resp = solve(K) - 1
if sum(map(int, str(K))) % D == 0:
    resp += 1
print(resp % MOD)


### FIXED CODE ###



MOD = 1000000007

def F(k, s):
    return dp[k][s]

def solve(n):
    resp = 0
    n = map(int, str(n))
    pref = 0
    for i in range(len(n)):
        for d in range(n[i]):
            resp += F(len(n) - i - 1, (pref - d) % D)
            resp %= MOD
        pref -= n[i]
        pref %= D
    return resp


K = raw_input()
D = input()

# dp[i][j] = cant de numeros de i digitos con suma % d = j
dp = [[0] * D for _ in range(len(K) + 1)]
dp[0][0] = 1
for i in range(1, len(K) + 1):
    for j in range(D):
        for d in range(10):
            dp[i][j] += dp[i - 1][(j - d) % D]
            dp[i][j] %= MOD

resp = solve(K) - 1
if sum(map(int, str(K))) % D == 0:
    resp += 1
print(resp % MOD)
### BUGGY CODE ###

import bisect
def main():
    N, Q = map(int, input().split())
    C = list(map(int, input().split()))
    E = []

    D = {C[i]: -1 for i in range(N)}
    for i in range(N):
        if D[C[i]] == -1:
            D[C[i]] = i
        else:
            E.append((D[C[i]], i, -1))
            D[C[i]] = i

    for i in range(Q):
        l, r = map(int, input().split())
        E.append((l - 1, r - 1, i))

    def f(tup):
        return tup[0]
    E.sort(key=f, reverse=True)

    ANS = [0] * Q
    y_list = []
    for e in E:
        if e[2] == -1:
            y_list.append(e[1])
            y_list.sort()
        else:
            ans = bisect.bisect_right(y_list, e[1])
            ANS[e[2]] = e[1] - e[0] + 1 - ans

    for i in range(Q):
        print(ANS[i])

if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import defaultdict
import sys
def read():
    return sys.stdin.readline().rstrip()
def main():
    N, Q = map(int, read().split())
    C = list(map(int, read().split()))
    E = defaultdict(list)

    D = [-1] * (N + 1)
    for i in range(N):
        D_i = D[C[i]]
        if D_i != -1:
            E[D_i].append((D_i, i))
        D[C[i]] = i

    F = defaultdict(list)
    for i in range(Q):
        l, r = map(int, input().split())
        F[l-1].append((r - 1, i))



    # Binary Indexed Tree (Fenwick Tree)
    class BIT:
        def __init__(self, n):
            self.n = n
            self.data = [0] * (n + 1)
            self.el = [0] * (n + 1)

        def sum(self, i):
            s = 0
            while i > 0:
                s += self.data[i]
                i -= i & -i
            return s

        def add(self, i, x):
            # assert i > 0
            self.el[i] += x
            while i <= self.n:
                self.data[i] += x
                i += i & -i

        def get(self, i, j=None):
            if j is None:
                return self.el[i]
            return self.sum(j) - self.sum(i)

    ANS = [0] * Q
    d = BIT(N)
    for x in range(N - 1, -1, -1):
        for e in E[x]:
            d.add(e[1], 1)
        for f in F[x]:
            ANS[f[1]] = f[0] - x + 1 - d.sum(f[0])

    for i in range(Q):
        print(ANS[i])

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

n,m =map(int,input().split())
a=[1]*n
b=[0]*n
for i in range(m):
  l,r=map(int,input().split())
  if l==1:
    a[r:]=b[r:]
  else:
    a[:l-1]=b[:l-1]
    a[r:]=b[r:]
print(sum(a))

### FIXED CODE ###

n,m=map(int,input().split())
l,r=1,n
for i in range(m):
    L,R=map(int,input().split())
    l=max(l,L)
    r=min(r,R)
if l>r:
    print(0)
else:   
    print(r-l+1)
### BUGGY CODE ###

import re
N,Q = map(int, input().split())
S = input()
for i in range(Q):
  l,r = map(int, input().split())
  #print(S[l-1:r], re.findall('AC', S[l-1:r]))
  print(len(re.findall('AC', S[l-1:r])))

### FIXED CODE ###

#!/usr/bin/env python3
import sys

def main():
    N, Q = map(int, input().split())
    S = input()
    ans = [None] * N
    ans[0] = S.count('AC')
    for i in range(1,N):
        ans[i] = ans[i-1]
        if S[i-1:i+1] == 'AC':
            ans[i] -= 1

    for i in range(Q):
        l, r = map(int, input().split())
        print(ans[l-1] - ans[r-1])

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

import math
K = int(input())

res = sum([math.gcd(math.gcd(a+1, b+1), c+1) for a in range(K) for b in range(K) for c in range(K)])
print(res)

### FIXED CODE ###

import math
K = int(input())
gcds = [math.gcd(a+1, b+1) for a in range(K) for b in range(K)]
res = sum([math.gcd(ab, c+1) for ab in gcds for c in range(K)])
print(res)
### BUGGY CODE ###

N = int(input())
ans = [0] * 10050

for x in range(1, 500):
    for y in range(1, 500):
        for z in range(1, 500):

            f = x**2 + y**2 + z**2 + x*y + y*z + z*x

            if f < 10000:
                ans[f-1] = ans[f-1] + 1 


for i in range(N):
    print(ans[i])

### FIXED CODE ###

N = int(input())
ans = [0] * 10050

for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):

            f = x**2 + y**2 + z**2 + x*y + y*z + z*x

            if f < 10050:
                ans[f-1] = ans[f-1] + 1 


for i in range(N):
    print(ans[i])
### BUGGY CODE ###

# -*- coding: utf-8 -*-

n, a, b = map(int, input().split())

sum = 0

if n <= a:
    sum = n

elif n <= (a + b):
    sum = a

else:
    while n >= (a + b):
        sum += a
        n -= (a + b)

    if n <= a:
        sum += n

    elif n <= (a + b):
        sum += a

print(sum)

### FIXED CODE ###

# -*- coding: utf-8 -*-

#入力
n, a, b = map(int, input().split())

sum = 0

if n <= a:
    sum = n

elif n <= (a + b):
    sum = a

else:
    p = n // (a + b)
    sum += a * p
    n -= p * (a + b)

    if n <= a:
        sum += n

    elif n <= (a + b):
        sum += a


#出力
print(sum)
### BUGGY CODE ###

import numpy as np
n=int(input())
s=input()
l=np.array([0])
r=np.array([0])
for i in range(n):
    if s[i]=="#":
        l=np.append(l,l[i]+1)
    else:
        l=np.append(l,l[i])
    if s[n-i-1]==".":
        r=np.append(r,r[i]+1)
    else:
        r=np.append(r,r[i])
r=r[::-1]
print(min(l+r))

### FIXED CODE ###

n=int(input())
s=input()
l=[0]
r=[0]
for i in range(n):
    if s[i]=="#":
        l.append(l[i]+1)
    else:
        l.append(l[i])
    if s[n-i-1]==".":
        r.append(r[i]+1)
    else:
        r.append(r[i])
r.reverse()
print(min([l[i]+r[i] for i in range(n+1)]))
### BUGGY CODE ###

n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]

for i in range(1,n+1):
    if(k-q+a.count(i) > 0):
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]

p=[0]*(n+1)
for i in a:
    p[i]+=1

for i in range(1,n+1):
    if(k-q+p[i] > 0):
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

N, Q = (int(i) for i in input().split())
L = [0] * 2 * N
P = {}
for i in range(N):
    S, T, X = (int(i) for i in input().split())
    L[2 * i] = (S-X, X, 1)
    L[2 * i + 1] = (T-X, X, 0)

L.sort(reverse=True)

Xs = set([])
for i in range(Q):
    D = int(input())
    ans = 0
    while True:
        if not L:
            break
        tp = L.pop()
        t = tp[0]
        if t <= D:
            if tp[2] == 1:
                Xs.add(tp[1])
            else:
                Xs.remove(tp[1])
        else:
            L.append(tp)
            break
    if Xs:
        print(min(Xs))
    else:
        print("-1")

### FIXED CODE ###

import sys
input = sys.stdin.readline

import heapq
N, Q = (int(i) for i in input().split())
L = [0] * (2 * N + Q)
for i in range(N):
    S, T, X = (int(i) for i in input().split())
    L[2 * i] = (S-X, 1, X)
    L[2 * i + 1] = (T-X, -1, X)
for i in range(Q):
    D = int(input())
    L[2 * N + i] = (D, 2, 0)
L.sort()

Xs = set([])
XH = []
heapq.heapify(XH)
for t, f, X in L:
    if f == 1:
        Xs.add(X)
        heapq.heappush(XH, X)
    elif  f == -1:
        Xs.remove(X)
    else:
        if Xs:
            while XH[0] not in Xs:
                X = heapq.heappop(XH)
            print(XH[0])
        else:
            print("-1")
### BUGGY CODE ###

import sys
#input = sys.stdin.buffer.readline

def main():
    s = str(input())
    l = len(s)
    dp = [[0 for _ in range(13)] for _ in range(2)]
    MOD = 10**9+7
    dp[0][0] = 1
    now,use = 0,1
    
    for st in s:
        for j in range(13):
            if st != "?":
                num = int(st)
                dp[use][(j*10+num)%13] = dp[now][j]
            else:
                for k in range(10):
                    dp[use][(j*10+k)%13] += dp[now][j]
            dp[use][j] %= MOD
        dp[now] = [0 for _ in range(13)]
        now,use = use,now
    
    print(dp[now][5]%MOD)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
#input = sys.stdin.buffer.readline

def main():
    s = str(input())
    l = len(s)
    ans = [0 for _ in range(13)]
    MOD = 10**9+7
    ans[0] = 1
    
    for st in s:
        dp = [0 for _ in range(13)]
        for i in range(13):
            dp[(10*i)%13] = ans[i]%MOD
        dp += dp
        if st != "?":
            for i in range(13):
                num = int(st)
                ans[i] = dp[i+13-num]
        else:
            for i in range(13):
                ans[i] = sum(dp[i+4:i+14])
    
    print(ans[5]%MOD)

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

# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
import math

def run():
    N = int(input())
    for n in range(1, N+1):
        ret = 0
        val = int(math.log2(2 * n))
        for X in range(-val, val+1):
            for Y in range(-val, val+1):
                tmp1 = 2 * n - X ** 2 - Y ** 2
                if tmp1 >= 0 and math.sqrt(tmp1) == int(math.sqrt(tmp1)):
                    Z_ = int(math.sqrt(tmp1))
                    if Z_ != 0:
                        for k in [-1, 1]:
                            Z = Z_ * k
                            if not (X + Y + Z) % 2:
                                xyz = (X + Y + Z) // 2
                                x = xyz - Y
                                y = xyz - Z
                                z = xyz - X
                                if x >= 1 and y >= 1 and z >= 1:
                                    ret += 1
                                    #print(x, y,z)
                    else:
                        if not (X + Y + Z_) % 2:
                            xyz = (X + Y + Z_) // 2
                            x = xyz - Y
                            y = xyz - Z_
                            z = xyz - X
                            if x >= 1 and y >= 1 and z >= 1:
                                ret += 1

        print(ret)



if __name__ == "__main__":
    run()


### FIXED CODE ###

# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
import math

def run():
    N = int(input())
    for n in range(1, N+1):
        ret = 0
        val = int(math.sqrt(2 * n))
        for X in range(2, val+1):
            for Y in range(2, val+1):
                tmp1 = 2 * n - X ** 2 - Y ** 2
                if tmp1 >= 0 and math.sqrt(tmp1) == int(math.sqrt(tmp1)):
                    Z_ = int(math.sqrt(tmp1))
                    if Z_ != 0:
                        for k in [-1, 1]:
                            Z = Z_ * k
                            if not (X + Y + Z) % 2:
                                xyz = (X + Y + Z) // 2
                                x = xyz - Y
                                y = xyz - Z
                                z = xyz - X
                                if x >= 1 and y >= 1 and z >= 1:
                                    ret += 1
                                    #print(x, y,z)


        print(ret)



if __name__ == "__main__":
    run()