peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
from collections import deque

n, m = map(int, input().split())
part = []
for i in range(n):
    part.append(list(map(int, input().split())))
part.sort(reverse=True)
part.sort(reverse=True, key=lambda x: x[1])

que = deque()
for i in part:
    que.append(i)

ans = 0
for day in range(1, n + 1):
    while que:
        work = que.popleft()
        if day + work[0] <= m + 1:
            ans += work[1]
            break
    if not que:
        break

print(ans)
# Judge status: Accepted
n = int(input())
a_list = []
b_list = []
ans = 0

for i in range(n):
    a,b = map(int,input().split())
    a_list.append(a)
    b_list.append(b)

for i,j in zip(a_list[::-1],b_list[::-1]):
    if (i+ans)%j != 0:
        inc = j - ((i+ans)%j)
        ans += inc
print(ans)
# Judge status: Accepted
N,M =map(int,input().split())

if N==M:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
D, T, S=map(int,input().split())

if D/S<=T:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
sumlow = 0
sumhigh = 0
i = 0
j = N-1
while i<=j:
    if sumlow <= sumhigh:
        sumlow += A[i]
        i += 1
    else:
        sumhigh += A[j]
        j -= 1
print(abs(sumlow-sumhigh))
# Judge status: Accepted
N = int(input())
w = [list(map(int, input().split())) for i in range(N)]
w.sort(key = lambda w : w[1])
t = 0
for i in range(N):
    t += w[i][0]
    if t > w[i][1]:
        print('No')
        break
else:
    print('Yes')
# Judge status: Accepted
n = int(input())
ans = ''
while n > 0:
    n -= 1
    ans += chr(ord('a') + n % 26)
    n //= 26
print(ans[::-1])
# Judge status: Accepted
N, M = [int(i) for i in input().split()]
if 2 * N >= M:
    print(M // 2)
else:
    print(N + (M - N - N) // 4)
# Judge status: Accepted
k, x = map(int, input().split())
print('Yes' if 500*k >= x else 'No')
# Judge status: Accepted
S = list(input())
ACGT = ['A', 'C', 'G', 'T']

count_list = []
for i in range(len(S)):
    count = 0
    for j in range(i, len(S)):
        if S[j] in ACGT:
            count += 1
        else:
            break
    count_list.append(count)

print(max(count_list))
# Judge status: Wrong Answer
N = int(input())
li = list(map(int, input().split()))
li.sort()
a = li[N//2]
flag = True
print(li)
for i in range (N//2):
    if a == li[i]:
        flag = False
if flag:
     print(li[N//2]-li[N//2-1])
else:
     print(0)
# Judge status: Accepted
#!/usr/bin/python
# -*- coding: utf-8 -*-

# 入力はstringで入る．
# intにしたければ int(input())
# floatで受け取ると 1.0 になる．

# 入力 : N M
N,M = map(int,input().split())

print(int(N*(N-1)/2+M*(M-1)/2))
# Judge status: Wrong Answer
l = list(map(int, input().split()))
n = len(l)
d = 0
l.sort()
for i in range(0,n-1):
    d += l.pop(0)
    print(l)

print(d)
# Judge status: Wrong Answer
N,K = map(int,input().split())
a = input().split()
a = [int(i) for i in a]
la = sorted(a)
sum(la[:K])
# Judge status: Accepted
a = list(map(int,input().split()))
ans = (a[0]*a[1])%2 
if ans == 1:
  print('Odd')
  
else:
  print('Even')
# Judge status: Accepted
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n = int(input())
ans = 0
for a in range(1, n+1):
    ans += (n - 1) // a
print(ans)
# Judge status: Accepted
n = int(input())

isEnd = False
sum = [0]*n

for x in range(1,100):
    x2 = x*x
    for y in range(1,100):
        sum_xy = x2 + y*(x+y)
        if sum_xy > n:
            break
        for z in range(1,100):
            tmp = sum_xy + z*(x+y+z)
            if tmp > n:
                break
            if tmp <= n:
                sum[tmp-1]+=1
for s in sum:
    print (s)
# Judge status: Accepted
i=input()
m=list(map(int,input().split()))
c=0
for i in range(1,len(m)-1):
    if m[i - 1] > m[i] > m[i + 1]:
        c+=1
    elif m[i - 1] < m[i] < m[i + 1]:
        c+=1
print(c)
# Judge status: Accepted
from decimal import Decimal
n,k=map(int,input().split())
ans=0
ans+=Decimal(max(0,(n+1-k))/n)
for i in range(1,min(k,n+1)):
    tmp=i
    tt=Decimal(1/n)
    while 0<tmp<k:
        tmp*=2
        tt=Decimal(tt/2)
        if tmp>=k:
            ans+=Decimal(tt)
print(Decimal(ans))
# Judge status: Accepted
import math
a=int(input())
b=math.sqrt(a)
n=math.ceil(b)
m=math.floor(b)
print(m**2)
# Judge status: Accepted
n = int(input())
s = input()
if n >= 3200:
  print(s)
else:
  print("red")
# Judge status: Accepted
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    ab, bc, ca = map(int, sys.stdin.readline().split())

    print(int(ab*bc/2))


if __name__ == '__main__':
    main()
# Judge status: Accepted
n,d=map(int,input().split())
a=[list(map(int,input().split())) for j in range(n)]
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    dis=0
    for k in range(d):
      dis+=(a[i][k]-a[j][k])**2
    dis=dis**(0.5)
    if dis==int(dis):
      ans+=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
x = list(map(int, input().split()))

if n==2:
    print(x[1])
    print(x[0])
    exit()

x_sort = sorted(x)

med1_ix = n//2-1
med2_ix = n//2

med1 = x_sort[med1_ix]
med2 = x_sort[med2_ix]

for i in x:
    if i <= med1:
        print(med1)
    else:
        print(med2)
# Judge status: Accepted
N = int(input())
Num = [int(2**i) for i in range(7)]
if N in Num:
  print(N)
else:
  Num.append(N)
  Num = sorted(Num)
  print(2 ** (Num.index(N) - 1))
# Judge status: Accepted
data = input().split()
time = int(data[0]) /  int(data[2])
if int(data[1]) >= time :
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b = map(int, input().split())

ans = 0
for i in range(a,b+1):
  if str(i) == str(i)[::-1]:
    ans += 1
print(ans)
# Judge status: Wrong Answer
def main():
    text = input()
    for c in text:
        if c == '?':
            print('D')
        else:
            print(c)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if (c >= a) and (b >= c):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
N=int(input())
a=list(map(int, input().split()))
S=1
c=0
for j in range(N):
  if S==a[j]:
    S+=1
  elif S!=a[j]:
    c+=1
if c==N:
  print(-1)
  exit()
print(c)
# Judge status: Accepted
s = input()

for i in range(len(s)):
    if s[i] == "A":
        start = i
        break
for i in range(len(s) - 1, -1, -1):
    if s[i] == "Z":
        end = i
        break
print(end - start + 1)
# Judge status: Accepted
import sys
input = sys.stdin.readline
 
K,S=map(int,input().split())

if S < K:
  K = S
 
z = list(range(K+1))
ans = []
 
for i in z:
  s_z = S - i
  if s_z < 0:
    pass
  elif K < s_z:
    if (K + 1) > (s_z - K):
      ans.append(K*2 - s_z + 1)
  else:
    ans.append(s_z + 1)
 
print(sum(ans))
# Judge status: Accepted
import itertools
n,m=map(int,input().split())
ab= [list(map(int,input().split())) for _ in range(m)]
ab=list(itertools.chain.from_iterable(ab))
for i in range(1,n+1):
    print(ab.count(i))
# Judge status: Accepted
import collections

n=int(input())
arr=list(map(int,input().split()))
cnt=collections.Counter(arr)
keys=cnt.keys()
keys=sorted(keys,reverse=True)
a=0
b=0
for key in keys:
  if b!=0:
    break
  if a==0:
    if cnt[key]>=2:
      a=key
      if cnt[key]>=4:
        b=key
  else:
    if cnt[key]>=2:
      b=key
print(a*b)
# Judge status: Accepted
n, m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
cd = [list(map(int,input().split())) for _ in range(m)]

for i in range(n):
    dis = []
    for j in range(m):
        dis.append(abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1]))
    ans = dis.index(min(dis))
    print(ans+1)
# Judge status: Accepted
n, k = map(int, input().split())
cdl = list(map(int, input().split()))
res = 5 * 10 ** 8
for i in range(n-k+1):
    l = cdl[i]
    r = cdl[i+k-1]
    res = min(res, abs(l)+abs(r-l), abs(r)+abs(r-l))
print(res)
# Judge status: Accepted
import math

a, b, x = map(int, input().split())
if x <= a*a*b/2:
  print(math.degrees(math.atan(a*b*b/(2*x))))
else:
  print(math.degrees(math.atan(2*(a*a*b-x)/(a**3))))
# Judge status: Accepted
n, m = list(map(int, input().split()))

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

l = make_divisors(m)

l.reverse()


for x in l:
    if m // x >= n:
        print(x)
        break
# Judge status: Accepted
s = list(input())
t = list(input())
ans=len(t)

for i in range(len(s)-len(t)+1) :
  check = len(t)
  for j in range(len(t)) :
    if s[i+j]==t[j] :
      check -= 1
  if ans > check :
    ans = check
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())
print((A + B) // 2) if A % 2 == B % 2 else print("IMPOSSIBLE")
# Judge status: Wrong Answer
S=input()
print("A" if S.islower() else "a")
# Judge status: Accepted
n,a,b=map(int,input().split())
if (b-a)%2==0:
    print((b-a)//2);exit()
a-=1;b-=1
# print(min(b,n-1-a))
ans1=0; ans2=0
ans1+= a
aa=0 ; bb=b-a 
ans1+= (bb//2+1)

ans2=n-1-b 
b=n-1
a+=ans2
ans2+= (b-a)//2+1

print(min(ans1,ans2))
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
c = Counter(a)
x = []
y = []
for i in c:
    if c[i] > 3:
        y.append(i)
    if c[i] > 1:
        x.append(i)
x.sort()
y.sort()
ans1 = ans2 = 0
if len(x) > 1:
    ans1 = x[-1]*x[-2]
if len(y) > 0:
    ans2 = y[-1]**2
print(max(ans1, ans2))
# Judge status: Accepted
s = input()
s = s[::-1]
n = len(s)

num = [0]*2019
num[0] = 1
number = 0
d = 1

for i in s:
    number += int(i)*d
    num[number%2019] += 1
    d *= 10
    d %= 2019

ans = 0

for i in num:
    ans += i*(i-1)//2

print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
ANSlist = [1]*(N)

for i in range(K):
    I = input() #
    S = list(input())
    for j in range(len(S)):
        if S[j] != " ":
            ANSlist[int(S[j])-1] = 0

ANS = 0

for i in range(len(ANSlist)):
    if ANSlist[i] != 0:
        ANS += 1

print(ANS)
# Judge status: Accepted
n,x = map(int,input().split())
l = list(map(int, input().split()))

d = 0
ans = 1
for i in range(n):
    d = d + l[i]
    if d <= x :
         ans +=1
    else:
        break
print(ans)
# Judge status: Accepted
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq

n = ni()
H = lma()
cnt=0
tmp=0
prev=H[0]
for h in H:
    if prev>=h:
        tmp+=1
    else:
        cnt=max(cnt,tmp)
        tmp=1
    prev=h
print(max(cnt,tmp)-1)
# Judge status: Wrong Answer
N = 60
x = 800 * N
y = 200 * (N // 15)

print(x - y)
# Judge status: Wrong Answer
K = int(input())
N = 10
a = 0
l = 9*K
for i in range(1,10**6):
  N = (10*N)%l
  if (N*7-7)%l==0:
    print(i+1)
    a +=1
    break
if(a == 0):
  print(-1)
# Judge status: Accepted
A,B=input().split()
print(int(A)*int(B.replace('.',''))//100)
# Judge status: Wrong Answer
N = int(input())
data = input().split(" ")
visit = [0 for i in range(N)]
ans = 0
for i in range(N):
  for j in range(N):
    if (data[j] == data[i])and(visit[i]==0)and(visit[j]==0):
      visit[i] = 1
      visit[j] = 1
      ans += 1
      
  print(ans)
# Judge status: Accepted
S = input()
T = input()

lens = len(S) - len(T) + 1

for i in reversed(range(lens)) :
    flag = True
    for j in range(len(T)) :
        if S[i+j] != T[j] and S[i+j] != "?":
            flag = False
    if flag == True :
        ans = S[:i] + T + S[i+len(T):]
        print(ans.replace("?", "a"))
        exit()

print("UNRESTORABLE")
# Judge status: Wrong Answer
A, B = map(int, input().split(' '))
print((B + A - 1) // A)
# Judge status: Accepted
s = input()
c = s.count('0')

print(2 * min(c, len(s)-c))
# Judge status: Wrong Answer
from collections import Counter
N, K = map(int, input().split())
A = list(map(int, input().split()))

c = Counter(A)
# print('c', c)
c = sorted(c, reverse=True)
# print('c', c)

ans = sum(c[K:])
# print('c[k:]', c[K:])
print(ans)
# Judge status: Wrong Answer
from random import randint
print(randint(0,1))
# Judge status: Accepted
S = list(input())
former = ''
tmp = []
count = 0
for i in range(len(S)):
    tmp.append(S[i])
    if not ''.join(tmp) == former:
        former = ''.join(tmp)
        tmp = []
        count += 1
print(count)
# Judge status: Accepted
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
c=0
A.insert(0,0)
B.insert(0,0)
import numpy as np
A=np.array(A).cumsum()
B=np.array(B).cumsum()

for i in range(N+1):
  d=K-A[i]
  for j in reversed(range(M+1)):
    if d-B[j]>=0:
      if c<i+j:
        c=i+j
      M=j
      break
print(c)
# Judge status: Accepted
# ABC164a


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

    s, w = map(int, input().split())
    if s <= w:
        print('unsafe')
    else:
        print('safe')


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())


def modpow(a, n):
    mod = 10 ** 9 + 7
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


print(modpow(10, n) - 2 * modpow(9, n) + modpow(8, n))
# Judge status: Wrong Answer
O = input()
E = input()
print(*[o+e for o,e in zip(O,E)], sep="")
# Judge status: Accepted
num = list(input())

num.sort(reverse=True)
X = num[0] + num[1]

print(int(X) + int(num[2]))
# Judge status: Accepted
def solve():
  ans = 0
  S = input()
  n = len(S)
  for i in range(n//2-1,0,-1):
    if S[:i]==S[i:2*i]:
      return i*2
print(solve())
# Judge status: Wrong Answer
X = list(input())
if len(X)<=2:
    print(-1)
    exit()
con = X[len(X)-2:len(X)]
kak = X[0:len(X)-2]
kak = int("".join(kak))
con = int("".join(con))
if con>=5:
    imp1 = con//5
    imp2 = con%5
else:
    imp1 = 1
    imp2 = 0
#print(kak, imp1, imp2)
if kak>=imp1+imp2:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = int(input())
    print('Yes'if N // 500 <= A else'No')


if __name__ == "__main__":
    main()
# Judge status: Accepted

N=int(input())
#print(list(N))
cnt=0
for i in range(1,N+1):
    if len(str(i))%2==1:
        cnt+=1
print(cnt)
# Judge status: Wrong Answer
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

H, W = map(int, readline().split())

import math

w_can = W // 2
ans = w_can * H
if W % 2 != 0:
    ans += math.ceil(H / 2)

print(ans)
# Judge status: Accepted
x,y = map(int,input().split())
ans = 10**10
if x<=y: ans = min(ans,y-x)
if -x<=y: ans = min(ans,1+y-(-x))
if x<=-y: ans = min(ans,-y-x+1)
if -x<=-y: ans = min(ans,-y-(-x)+2)
print(ans)
# Judge status: Accepted
a, b, c = map(str,input().split())
print('A'+b[0]+'C')
# Judge status: Wrong Answer
h,w=map(int,input().split())

if h*w%2==1:
  print(h*w//2+1)
else:
  print(h*w//2)
# Judge status: Accepted
n,k = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
H.reverse()
print(sum(H[k:]))
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a<b:
    print(a)
elif a>=b:
    print(b)
# Judge status: Wrong Answer
x = int(input())
lank8 = list(range(400, 600))
lank7 = list(range(400, 800))
lank6 = list(range(400, 1000))
lank5 = list(range(400, 1200))
lank4 = list(range(400, 1400))
lank3 = list(range(400, 1600))
lank2 = list(range(400, 1800))
lank1 = list(range(400, 200))
if x in lank8:
    print(8)
elif x in lank7:
    print(7)
elif x in lank6:
    print(6)
elif x in lank5:
    print(5)
elif x in lank4:
    print(4)
elif x in lank3:
    print(3)
elif x in lank2:
    print(2)
elif x in lank1:
    print(1)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

c = max(0, sum(B) - sum(A))
ca = 0
cb = 0
import math
for a, b in zip(A, B):
    if a < b:
        ca += math.ceil((b - a) / 2)
    if a > b:
        cb += a - b

if c < ca + cb:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
S = list(input())

ans = 1
prev = S[0]
for i in range(1, len(S)):
    if prev == S[i]:
        prev = prev + S[i]
        if i == len(S) - 1:
            ans += 1
    else:
        ans += 1
        prev = S[i]

print(ans)
# Judge status: Accepted
n = int(input())

ans = 0
for i in range(1,(n+1)):
    #print(i)
    if i % 3 == 0 or i % 5 == 0:
        continue
    else:
        ans += i

print(ans)
# Judge status: Accepted
import collections
n = int(input())
s = [str(input()) for i in range(n)]
m = int(input())
t = [str(input()) for i in range(m)]
set_s = set(s)
set_t = set(t)
blue = set(s) - set(t)
ss = collections.Counter(s)
tt = collections.Counter(t)
set_s_t = set(s) & set(t)
Max = -999999999
for i in set_s_t:
    Max = max(Max,ss[i]-tt[i])
for i in blue:
    Max = max(Max,ss[i])
if Max < 0:
    Max = 0
print(Max)
# Judge status: Wrong Answer
import math
a,b,c,d=map(int,input().split())
lcm=(c*d)//math.gcd(c,d)
ans=(b-a)-((b//c-a//c)+(b//d-a//d)-(b//lcm-a//lcm))+1
print(ans)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

N,K = map(int,input().split())

bef=-1
x =0
count = 0
Bool=True
if N%K < K:
	bef=N%K
	Bool=False
while Bool:
	if count>0:
		N=bef
	x=abs(N-K)
	count+=1
	if bef>=0 and bef<=x:
		break
	bef=x

print(bef)
# Judge status: Accepted
S=input()
if S[-1] == "s":
    S = S + "es"
else:
    S = S + "s"
print(S)
# Judge status: Wrong Answer
N=int(input())
count=0
ans=0
tmp=5
ans=(N//11)*2
if N%11>6:
	print(ans+2)
else:
	print(ans+1)
# Judge status: Accepted
n,m = map(int,input().split())
a = set([int(input()) for _ in range(m)])
dp = [0]*(n+1)
INF = 1000000007

dp[0] = 1
if 1 not in a:
  dp[1] = 1

for i in range(2,n+1):
    if i-1 not in a :
      dp[i] += dp[i-1] #n-1 段目が安全なら
    if i-2 not in a :
      dp[i] += dp[i-2] #n-2 段目が安全なら
    dp[i] %= INF

print(dp[n])
# Judge status: Wrong Answer
a = int(input())
data = list(map(int, input().split()))
l =[]
money = 1000
stock = 0

for i in data:
  if i not in l:
    l += [i]

diff = []
dd = []
for i in range(len(l) - 1):
  if l[i] < l[i + 1]:
    if not diff:
      diff += [l[i + 1] - l[i]]
      dd += [[l[i + 1], l[i]]]
    elif diff[-1] < l[i + 1] - l[i]:
      diff += [l[i + 1] - l[i]]
      dd += [[l[i + 1], l[i]]]

for d in dd:
  stock = money // d[1]
  money -= stock * d[1]
  money += stock * d[0]
  stock = 0
print(money)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().rstrip().split(" ")))
counter = [0,0,0]
for i in a:
    if i % 4 == 0:
        counter[2] += 1
    elif i % 2 == 0:
        counter[1] += 1
    else:
        counter[0] += 1
if(counter[2] != 0): counter[1] +=1
p = (max(counter[1] - 1,0)) + (counter[2] + 1)

if p >= counter[0]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())

ans = 0

for i in range(1,n+1):
    n_i = n//i
    ans += i*n_i*(n_i+1)//2
    
print(ans)
# Judge status: Accepted
N, W = map(int, input().split())
wv = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * (W + 1) for _ in range(N)]

for i in range(N):
    for j in range(W + 1):
        dp[i][j] = max(dp[i][j], dp[i - 1][j])
        if j >= wv[i][0]:
            dp[i][j] = max(dp[i][j], dp[i - 1][j - wv[i][0]] + wv[i][1])
print(dp[N - 1][W])
# Judge status: Wrong Answer
A, B, C = input().split()
A = int(A)
B = int(B)
C = int(C)
if B == 0:
  print(0)
else:
  print(A-C)
# Judge status: Wrong Answer
n=int(input())%10
if n in [2,4,5,7,8]:
    print("hon")
elif n in[0,1,6,8]:
    print("pon")
else:
    print("bon")
# Judge status: Accepted
def actual(n, k):
    if n % k == 0:
        return 0

    return 1

n, k = map(int, input().split())
print(actual(n, k))
# Judge status: Accepted
A,B = map(int,input().split())
outlet = 1
cnt = 0
while outlet < B :
    outlet = outlet + A - 1
    cnt += 1
print(cnt)
# Judge status: Accepted
def main_v2():
    N = int(input())
    f_list = [0 for _ in range(N)]

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                ans = x*x + y*y + z*z + x*y + y*z + z*x
                if ans <= N:
                    f_list[ans - 1] += 1

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


if __name__ == "__main__":
    main_v2()
# Judge status: Wrong Answer
x = input()
if str(x) == 0:
    print("1")
else:
	print("0")
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(1, n - 1):
    if p[i - 1] > p[i] and p[i] > p[i + 1]:
        ans += 1
    if p[i - 1] < p[i] and p[i] < p[i + 1]:
        ans += 1
print(ans)
# Judge status: Wrong Answer
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

a, b = na()

s = 0
i = 1
ans = 0
while s <= a:
    s += i
    i += 1

print(s - a)
# Judge status: Wrong Answer
def main():
    N = int(input())
    ans = [0 for i in range(N + 1)]

    for x in range(1, 45):
        for y in range(1, 45):
            for z in range(1, 45):
                s = x**2 + y**2 + z**2 + x*y + y*z + z*x
                
                if 1 <= s <= N:
                    ans[s] += 1

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

if __name__ == "__main__":
    main()
# Judge status: Accepted
A, B, K = map(int, input().split())
mi = min(A, B)
l = []
for i in range(1, mi+1):
    if A % i == 0 and B % i == 0:
        l.append(i)
print(l[-K])
# Judge status: Accepted
n = int(input())
abl = []
for _ in range(n):
    a,b = map(int, input().split())
    abl.append((b,a))

abl.sort()
curr = 0
for b,a in abl:
    curr += a
    if curr > b:
        print('No')
        break
else:
    print('Yes')
# Judge status: Accepted
s = list(input())
t = list(input())

s.sort()
t.sort(reverse = True)

if s<t:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
H, A = map(int, input().split())

count =0
while True:
    H = H - A
    count += 1
    if H <= 0:
        break
    
print(count)
# Judge status: Wrong Answer
N=int(input())
card_list=sorted(list(map(int,input().split())),reverse=True)
A=sum(card_list[0::2])
B=sum(card_list[1::2])
print(A-B)
# Judge status: Accepted
def ispalindrome(S,N):
    for a, b in zip(S[:N], reversed(S[:N])):
        if a != b: return 0
    return 1

def ispalindrome2(S,N):
    for a, b in zip(S[N2-1:N], reversed(S[N2-1:N])):
        if a != b: return 0
    return 1

S = input()
N = len(S)
N1 = (N-1)//2
N2 = (N+3)//2

r1 = ispalindrome(S,N)
r2 = ispalindrome(S,N1)
r3 = ispalindrome2(S,N2)
if r1==1 and r2==1 and r3==1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N,M = (int(x) for x in input().split())
if N == 1:
    if M == 1:
        print('1')
    elif M == 2:
        print('0')
    else:
        print(M-2)
elif M == 1:
    if N == 2:
        print('0')
    else:
        print(N-2)
else:
    print((N-2)*(M-2))
# Judge status: Wrong Answer
import sys

if __name__ == '__main__':
    S = sys.stdin.readline()
    T = sys.stdin.readline()
    max_match = -1
    for i in range(len(T)):
        for j in range(i+1, len(T)):
            pos = S[i:-j].find(T[i:j])
            if max_match < j-i and pos != -1:
                max_match = j - i
    if max_match == -1:
        l = len(T)
    print(len(T)-max_match-1)
# Judge status: Accepted
s = input()
d={'a':0,'b':0,'c':0,}
for i in s:
    d[i] += 1
a=d['a']
b=d['b']
c=d['c']
if abs(a-b) > 1:
    print('NO')
    exit()
if abs(a-c) > 1:
    print('NO')
    exit()
if abs(c-b) > 1:
    print('NO')
    exit()
print('YES')
# Judge status: Wrong Answer
import math
X=int(input())
i=100
l=0
while i<X:
  i*=1.01
  i=math.floor(i)
  l+=1
print(l)
# Judge status: Wrong Answer
n = int(input())
s = input()
t = input()
cou = 0
for i in range(n):
  s1 = s[i:]
  t1 = t[:n-i]
#  print(s1,t1)
  if s1==t1:
    print(2*n-(n-i))