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

from collections import Counter

N, S = map(int, input().split())
A = [int(i) for i in input().split()]

mod = 998244353

B = []
for a in A :
  if a <= S :
    B.append(a)
    
C = list(Counter(B).items())

fac = [1]
inv = [1]
for i in range(1, 6010) :
  fac.append(fac[-1] * i % mod)
  inv.append(pow(fac[-1], mod - 2, mod))

def comb(n, r) :
  return fac[n] * inv[r] * inv[n - r] % mod

ret = 0
def dfs(n, s, cnt, pat) :
  if n == -1 :
    if s == S :
      global ret
      ret += pow(2, N - cnt, mod) * pat
      ret %= mod
    return
  for i in range(C[n][1] + 1) :
    if s + C[n][0] * i <= S :
      dfs(n - 1, s + C[n][0] * i, cnt + i, pat * comb(C[n][1], i) % mod)
  
dfs(len(C) - 1, 0, 0, 1)

print(ret)

### FIXED CODE ###

N, S = map(int, input().split())
A = [int(i) for i in input().split()]

mod = 998244353

dp = [0] * (S + 1)
dp[0] = 1
for a in A :
  for i in range(S, -1, -1) :
    if i >= a :
      dp[i] = dp[i] * 2 + dp[i - a]
    else :
      dp[i] = dp[i] * 2
    dp[i] %= mod
print(dp[-1])
### BUGGY CODE ###

#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10 ** 6)

def main():
    n = int(input())
    adj_list = [[] for i in range(n)]
    for i in range(n - 1):
        a1, b1 = map(int, input().split())
        adj_list[a1 - 1].append(b1 - 1)
        adj_list[b1 - 1].append(a1 - 1)
    path = dfs(0, -1, adj_list, n)
    assert len(path) >= 2
    fpath = len(path) - len(path) // 2
    cut = set(path[fpath - 1:fpath + 1])
    f = dfs2(0, -1, adj_list, n, cut)
    s = dfs2(n - 1, -1, adj_list, n, cut)
    assert f + s == n
    print("Fennec" if f > s else "Snuke")

def dfs(now, prev, adj_list, n):
    if now == n - 1:
        return [now]
    for next in adj_list[now]:
        if next == prev:
            continue
        p = dfs(next, now, adj_list, n)
        if p is not None:
            return [now] + p

def dfs2(now, prev, adj_list, n, cut):
    size = 1
    for next in adj_list[now]:
        if next == prev:
            continue
        if {now, next} == cut:
            continue
        s = dfs2(next, now, adj_list, n, cut)
        size += s
    return size

if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10 ** 6)

def main():
    n = int(input())
    adj_list = [[] for i in range(n)]
    for i in range(n - 1):
        a1, b1 = map(int, sys.stdin.readline().split())
        adj_list[a1 - 1].append(b1 - 1)
        adj_list[b1 - 1].append(a1 - 1)
    path = list(reversed(dfs(0, -1, adj_list, n)))
    assert len(path) >= 2
    fpath = len(path) - len(path) // 2
    cut = set(path[fpath - 1:fpath + 1])
    f = dfs2(0, -1, adj_list, n, cut)
    s = dfs2(n - 1, -1, adj_list, n, cut)
    assert f + s == n
    print("Fennec" if f > s else "Snuke")

def dfs(now, prev, adj_list, n):
    if now == n - 1:
        return [now]
    for next in adj_list[now]:
        if next == prev:
            continue
        p = dfs(next, now, adj_list, n)
        if p is not None:
            p.append(now)
            return p

def dfs2(now, prev, adj_list, n, cut):
    size = 1
    for next in adj_list[now]:
        if next == prev:
            continue
        if {now, next} == cut:
            continue
        s = dfs2(next, now, adj_list, n, cut)
        size += s
    return size

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

# -*- coding: utf-8 -*-
import sys
from heapq import heappush, heappop, heapify

N,K=map(int, sys.stdin.readline().split())
A=map(int, sys.stdin.readline().split())
F=map(int, sys.stdin.readline().split())

A.sort()
F.sort(reverse=True)

hq=[]

for x,y in zip(A,F):
    heappush( hq,(-1*x*y,x,y) )


while 0<K:
    v=heappop(hq)
    x=v[1]
    y=v[2]
    x-=1
    K-=1
    heappush( hq,(-1*x*y,x,y) )

print hq[0][0]*-1

### FIXED CODE ###

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

N,K=map(int, sys.stdin.readline().split())
A=map(int, sys.stdin.readline().split())
F=map(int, sys.stdin.readline().split())
A.sort(reverse=True)
F.sort()

max_ans=A[0]*F[-1]

def check(temp_ans):
    if temp_ans<0:
        return False
    k=0
    for a,f in zip(A,F):
        if a*f<=temp_ans: continue
        aa=temp_ans/f
        k+=(a-aa)
        if K<k:
            return False
    else:
        return True

h=max_ans
l=-1

while h-l!=1:
    m=(h+l)/2
    if check(m):
        h=m
    else:
        l=m

print h
### BUGGY CODE ###

#!/usr/bin/env python3
s = input()
n = len(s)
while True:
    ns = s.replace("01", "").replace("10", "")
    if ns == s:
        break
    s = ns
print(n - len(s))


### FIXED CODE ###

#!/usr/bin/env python3
s = input()
n = len(s)
c = 0
p = ""
count = 0
for i in s:
    if i == p:
        count += 1
    else:
        c = count - c
        count = 1
    p = i
c = count - c
print(n - abs(c))
### BUGGY CODE ###

# 文字のリストを作成し、組み合わせを求めてアナグラムになっているかチェックする
import itertools

n = int(input())
s = list(input() for i in range(n))
s_comb = list(itertools.combinations(s, 2))

count = 0

for i in range(len(s_comb)):
    s_i = s_comb[i][0]
    # 文字列はsort()メッソドが使用できないので、sorted()で新しいリスト作成
    # 文字列を昇順にすることでアナグラムチェックしやすいようにする
    s_i_str_list = sorted(s_i)
    s_j = s_comb[i][1]
    s_j_str_list = sorted(s_j)
    
    # アナグラムかチェック
    if s_i_str_list == s_j_str_list:
        count += 1

print(count)

### FIXED CODE ###

n = int(input())
 
words = {}
anagrams = 0
 
for i in range(n):
    word = "".join(sorted(input()))
    if word not in words:
        words[word] = 1
    else:
        anagrams += words[word]
        words[word] += 1
 
print(anagrams)
### BUGGY CODE ###

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

ans = 0
sum = [0 for i in range(n+1)]

for i in range(1, n+1):
    sum[i] = sum[i-1] + a[i-1]

sum = sorted(sum)

for i in range(n):
    tmp = sum[i]
    for j in range(i+1, n+1):
        if tmp == sum[j]:
            ans += 1
        else:
            break

print(ans)

### FIXED CODE ###

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

ans = 0
sum = [0 for i in range(n+1)]

for i in range(1, n+1):
    sum[i] = sum[i-1] + a[i-1]

count = Counter(sum)

for values in count.values():
    if values >= 2:
        ans += values * (values-1) // 2

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

n,k=map(int,input().split())
ar=list(map(int,input().split()))
prod=1
for i in range(k):
    prod*=ar[i]
for i in range(k,n):
    x=prod*ar[i]//ar[i-k]
    if x>prod:
        print('Yes')
    else:
        print('No')
    prod=x



### FIXED CODE ###

from math import log2
n,k=map(int,input().split())
ar=list(map(int,input().split()))
for i in range(n):
    ar[i]=log2(ar[i])
prod=0
for i in range(k):
    prod+=ar[i]
for i in range(k,n):
    x=prod+ar[i]-ar[i-k]
    if x>prod:
        print('Yes')
    else:
        print('No')
    prod=x
### BUGGY CODE ###

import sys
input = sys.stdin.readline

n = int(input())
arr = [int(x) for x in input().split()]
Max = 3005

dp = [[0 for i in range(Max)] for i in range(Max)]

for l in range(n-1,-1,-1):
    for r in range(l, n):
        if l == r:
            dp[l][r] = arr[l]
        else:
            dp[l][r] = max(arr[l] - dp[l+1][r], arr[r] - dp[l][r-1])

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

### FIXED CODE ###

def deque(n, arr):
    dp = [[0] * n for _ in range(n)]
    for i in range(n):
        dp[i][i] = arr[i]

    for l in range(n-2, -1, -1):
        for r in range(l+1, n):
            L = arr[l] - dp[l+1][r]
            R = arr[r] - dp[l][r-1]
            dp[l][r] = L if L > R else R
    return dp[0][n-1]

n = int(input())
arr = [int(x) for x in input().split()]
print(deque(n, arr))
### BUGGY CODE ###

import collections

N,K=map(int,input().split())
P=list(map(int,input().split()))
cnt=0
tmp=0
ans=0
count=0
A=(N-K+1)
for i in range(A):
	#print(P[i:i+K])
	if cnt<sum(P[i:i+K]):
		cnt=sum(P[i:i+K])
		tmp=i
Q=P[tmp:tmp+K]
count=collections.Counter(Q)
C_K=list(count.keys())
C_V=list(count.values())
R=len(count.keys())
for i in range(R):
	ans+=(C_K[i]*(C_K[i]+1)/(2*C_K[i])*C_V[i])
print(ans)

### FIXED CODE ###

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

for i in range (N):
	E[i]=((P[i]+1)/2)

L=[0]*(N+1)
L[0]=0

for i in range (N):
	L[i+1]=L[i]+E[i]

ans=0

for i in range (K,N+1):
	ans=max(ans,L[i]-L[i-K])

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

n = int(input())
l = [int(i) for i in input().split()]
l.sort()
ans = 0
for i in range(n):
    a = l[i]
    for j in range(i + 1, n):
        b = l[j]
        c = a+b
        for k in range(j + 1, n):
            if l[k] < c:
                ans += 1
print(ans)


### FIXED CODE ###

import bisect
n = int(input())
l = [int(i) for i in input().split()]
l.sort()
k = 0
for i in range(n):
    for j in range(i + 1, n):
        ind = bisect.bisect_left(l, l[i] + l[j])
        k += max(ind-j-1, 0)
print(k)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+1):
    print(a.count(i))


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
f = [0]*(n+1)
for i in a:
    f[i] = f[i]+1
for i in range(1,n+1):
    print(f[i])
### BUGGY CODE ###

def main():
    N,K = map(int,input().split())
    P = list(map(int,input().split()))

    ans = []
    l = []
    for i in range(N-K+1):
        l.append(sum(P[i:i+K]))
    idx = l.index(max(l)) 
    ls = P[idx:K+idx]
    for j in range(K):
        ans.append((ls[j]+1)*ls[j]/(2*ls[j]))
    print(sum(ans))
main()

### FIXED CODE ###

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

summ = sum(P[0:K])
maxi = summ
idx = 0
ans = []
for i in range(N-K):
    summ = summ - P[i] + P[K+i]
    if summ > maxi:
        maxi = summ
        idx = i+1
for j in range(K):
    ans.append((P[idx+j]+1)/2)
print(sum(ans))
### BUGGY CODE ###

import sys
input=sys.stdin.readline
N=int(input())
C=[int(input()) for i in range(N)]
C=[C[i] for i in range(N) if i ==0 or C[i-1]!=C[i]]

import collections
table=collections.defaultdict(list)
N=len(C)
dp=[0]*(N+1)
dp[N]=1
mod=10**9 + 7
for i,x in enumerate(C[::-1]):
  dp[N-1-i]=dp[N-i]
  for y in table[x]:
    dp[N-1-i]+=dp[y+1]
  dp[N-1-i]%=mod
  table[x].append(N-1-i)

print(dp[0])


### FIXED CODE ###

import sys
input=sys.stdin.readline
N=int(input())
C=[int(input())]
for i in range(N-1):
  tmp=int(input())
  if tmp != C[-1]:
    C.append(tmp)
  
import collections
table=collections.defaultdict(int)
N=len(C)
dp=[0]*(N+1)
dp[N]=1
mod=10**9 + 7
for i,x in enumerate(C[::-1]):
  dp[N-1-i]=dp[N-i] + table[x] 
  dp[N-1-i]%=mod
  table[x]+=dp[N-i]
print(dp[0])
### BUGGY CODE ###

N = int(input())
P = [int(x) for x in input().split()]
L = [0] * (N + 2)
R = [N + 1] * (N + 2)
I = list(range(N + 1))
for i in range(N):
  I[P[i]] = i
cnt = 0
C = [0] * N
def ls(s, t):
  if s > t:
    return -1
  if s == t:
    return s if C[s] == 1 else -1
  m = (s + t) // 2
  return max(ls(s, m), ls(m + 1, t))
def rs(s, t):
  if s > t:
    return N
  if s == t:
    return s if C[s] == 1 else N
  m = (s + t) // 2
  return min(rs(s, m), rs(m + 1, t))
for i in range(N, 0, -1):
  index = I[i]
  idx = index + 1
  L[idx] = ls(0, index) + 1
  R[idx] = rs(idx, N - 1) + 1
  L[R[idx]] = idx
  R[L[idx]] = idx
  C[index] = 1
  cnt += i * ((idx - L[idx]) * (R[R[idx]] - R[idx]) + (L[idx] - L[L[idx]]) * (R[idx] - idx))
print(cnt)

### FIXED CODE ###

N = int(input())
P = [int(x) for x in input().split()]
L = [0] * (N + 2)
R = [N + 1] * (N + 2)
I = list(range(N + 1))
for i in range(N):
  I[P[i]] = i
ans = 0
ST = [0] * (N + 2)
def cnt(i):
  ret = 0
  while i:
    ret += ST[i]
    i -= i & (-i)
  return ret
def update(i):
  while i <= N + 1:
    ST[i] += 1
    i += i & (-i)
def ls(idx):
  b = cnt(idx)
  if b == 0:
    return 0
  s = 0
  t = idx
  while t - s > 1:
    m = (s + t) // 2
    if cnt(m) < b:
      s = m
    else:
      t = m
  return t
def rs(idx):
  b = cnt(idx)
  s = idx
  t = N + 1
  while t - s > 1:
    m = (s + t) // 2
    if cnt(m) > b:
      t = m
    else:
      s = m
  return t
for i in range(N, 0, -1):
  index = I[i]
  idx = index + 1
  L[idx] = ls(idx)
  R[idx] = rs(idx)
  L[R[idx]] = idx
  R[L[idx]] = idx
  update(idx)
  ans += i * ((idx - L[idx]) * (R[R[idx]] - R[idx]) + (L[idx] - L[L[idx]]) * (R[idx] - idx))
print(ans)
### BUGGY CODE ###

N,W = [int(v) for v in input().split()]
items = [[int(v) for v in input().split()] for _ in range(N)]

dp = [[0 for _ in range(W+1)] for _ in range(N+1)]

for i,(w,v) in enumerate(items,1):
    for cap in range(W+1):
        if cap - w >= 0:
            dp[i][cap] = max(dp[i][cap],dp[i-1][cap-w]+v)
        dp[i][cap] = max(dp[i][cap],dp[i-1][cap])

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


### FIXED CODE ###

N,W = [int(v) for v in input().split()]
dp = [[0 for _ in range(W+1)] for _ in range(N+1)]

for i in range(1,N+1):
    w,v = [int(v) for v in input().split()]
    for cap in range(W+1):
        if cap - w >= 0:
            dp[i][cap] = max(dp[i][cap],dp[i-1][cap-w]+v)
        dp[i][cap] = max(dp[i][cap],dp[i-1][cap])

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

#nord_aで使っている色の＋１
#初期入力
import sys
input = sys.stdin.readline
from collections import deque
N = int(input())
connection   ={i:set() for i in range(1,N+1)}
A            ={i:tuple() for i in range(1,N+1)}
for i in range(N-1):
    a,b = (int(x) for x in input().split())
    connection[a].add(b) # つながりを逆向きも含めて入力
    connection[b].add(a) # 
    A[i]=a,b             #色を出力するため

#色の数(各頂点の最大値)
color_max =0
for i in connection.values():
    color_max =max(color_max, len(i) )

#各頂点に色を準備⇒辺の色決定
color_node ={i:deque() for i in range(1,N+1)} #頂点に使った色の管理,dequeで高速？
color_edge =[0]*(N-1)

for i in range(N-1):
    n_a,n_b = A[i] #i番目の辺とつながっている頂点
    if color_node[n_a] !=deque():
        color =color_node[n_a][-1]
    else:
        color =0
    while True:
        #color +=1
        q,color =divmod(color,color_max)
        if color not in color_node[n_a] and color not in color_node[n_b]: 
            color_edge[i] =color+1          #辺の色を出力用に決める。1～color_max
            color_node[n_a].append(color)    #前の頂点に使った色を追加
            color_node[n_b].append(color)    #先の頂点に使った色を追加
            break
        else:
            color +=1      
#出力
print(color_max)
print(*color_edge, sep="\n")

### FIXED CODE ###

"""
参考    yy4さん 2019-11-24 21:24:43
516 ms          PyPy3 (2.4.0)
"""
#def solve():
from collections import deque
import sys

input = sys.stdin.readline

n = int(input())

g = tuple(set() for _ in range(n))
for idx in range(n - 1):
    a, b = (int(x) - 1 for x in input().split())
    g[a].add((b, idx))
    g[b].add((a, idx))

q = deque()
q.append((0, -1, -1))

e = [-1] * n  # e[-1]は使わない
used = [False] * n
used[0] = True
while q:
    v, v_idx, prev_color = q.popleft()
    curr = 1 if prev_color != 1 else 2
    for u, u_idx in g[v]:
        if used[u]:
            continue
        used[u] = True
        e[u_idx] = curr
        q.append((u, u_idx, curr))
        curr += 1
        if curr == prev_color:
            curr += 1

ret = e[:-1]
#return len(set(ret)), ret

    
#l, ret = solve()
l=len(set(ret))
print(l)
print(*ret, sep='\n')
### BUGGY CODE ###

def knapsack(n,w,wts,vals):
    if n==0 or w==0:
        return 0
    inc,exc=-1,-1
    if wts[n-1]<=w:
        inc= vals[n-1]+ knapsack(n-1,w-wts[n-1],wts,vals)
    exc= knapsack(n-1,w,wts,vals)

    return max(inc,exc)

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

print(knapsack(n,w,wts,vals))


### FIXED CODE ###

def knapsack_dp(n,w,wts,val):
    dp=[[0]*(w+1) for i in range(n+1)]

    for i in range(n+1):
        for j in range(w+1):
            if i==0 or j==0:
                dp[i][j]=0
            elif wts[i-1]<=j:
                dp[i][j]=max(dp[i-1][j],val[i-1]+dp[i-1][j-wts[i-1]])
            else:
                dp[i][j]=dp[i-1][j]

    return dp[n][w]


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

print(knapsack_dp(n,w,wts,vals))
### BUGGY CODE ###

N = int(input())
S = input()
X = [0]*3
for s in S:
  if s == "R":
    X[0] += 1
  elif s == "B":
    X[1] += 1
  else:
    X[2] += 1
total = X[0]*X[1]*X[2]
flag = [False] * 3
for i in range(N-2):
  for j in range(i+1, N-1):
    if S[i] == "R":
      flag[0] = True
    elif S[i] == "B":
      flag[1] = True
    else:
      flag[2] = True
    if S[j] == "R":
      flag[0] = True
    elif S[j] == "B":
      flag[1] = True
    else:
      flag[2] = True
    k = j + j - i
    if k <= N-1:
      if S[k] == "R":
        flag[0] = True
      elif S[k] == "B":
        flag[1] = True
      else:
        flag[2] = True
    #print(total, i,j,k, flag)
    if all(flag):
      total -= 1
    flag = [False]*3
print(total)

### FIXED CODE ###

N = int(input())
S = input()
X = [0]*3
for s in S:
  if s == "R":
    X[0] += 1
  elif s == "B":
    X[1] += 1
  else:
    X[2] += 1
total = X[0]*X[1]*X[2]
flag = [False] * 3
for i in range(N-2):
  for j in range(i+1, N-1):
    if S[i] == "R":
      flag[0] = True
    elif S[i] == "B":
      flag[1] = True
    else:
      flag[2] = True
    if S[j] == "R":
      flag[0] = True
    elif S[j] == "B":
      flag[1] = True
    else:
      flag[2] = True
    k = j + j - i
    if k <= N-1:
      if S[k] == "R":
        flag[0] = True
      elif S[k] == "B":
        flag[1] = True
      else:
        flag[2] = True
    if all(flag):
      total -= 1
    flag = [False]*3
print(total)
### BUGGY CODE ###

from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline
INF = float("inf")


# update: node[x] を更新する
# getmin: 区間 [a, b) の最小値を返す
class SegmentTree:
    def __init__(self, arr):
        size = len(arr)
        n = 1
        while n < size:
            n *= 2
        self.n = n
        self.node = [0]*(2*n - 1)
        for i in range(size):
            self.node[i+n-1] = arr[i]
        for i in reversed(range(n-2)):
            self.node[i] = max(self.node[2*i+1], self.node[2*i+2])
    
    def update(self, x, val):
        x += (self.n - 1)
        self.node[x] = val
        while x > 0:
            x = (x - 1) // 2
            self.node[x] = max(self.node[2*x+1], self.node[2*x+2])
    
    def getmax(self, a, b, k=0, l=0, r=-1):
        if r < 0:
            r = self.n
        if r <= a or b <= l:
            return 0
        if a <= l and r <= b:
            return self.node[k]
        
        vl = self.getmax(a, b, 2*k+1, l, (l+r)//2)
        vr = self.getmax(a, b, 2*k+2, (l+r)//2, r)
        return max(vl, vr)


# 処理内容
def main():
    N, K = map(int, input().split())
    
    seg = SegmentTree([0]*300010)
    ans = 0
    for _ in range(N):
        A = int(input())
        a = max(A-K, 0)
        b = min(A+K, 300000)
        tmp = seg.getmax(a, b+1) + 1
        ans = max(ans, tmp)
        seg.update(A, tmp)
    
    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline
INF = float("inf")


# update: node[x] を更新する
# getmin: 区間 [a, b) の最小値を返す
class SegmentTree:
    def __init__(self, arr):
        size = len(arr)
        n = 1 << size.bit_length()
        self.n = n
        self.node = [0]*(2*n - 1)
        for i in range(size):
            self.node[i+n-1] = arr[i]
        for i in reversed(range(n-2)):
            self.node[i] = max(self.node[2*i+1], self.node[2*i+2])
    
    def update(self, x, val):
        x += (self.n - 1)
        self.node[x] = val
        while x > 0:
            x = (x - 1) // 2
            self.node[x] = max(self.node[2*x+1], self.node[2*x+2])
    
    def getmax(self, l, r):
        res = 0
        l += self.n - 1
        r += self.n - 1
        while l <= r:
            res = max(res, self.node[l])
            res = max(res, self.node[r])
            l  = l // 2
            r = r // 2 - 1
        return res
 

# 処理内容
def main():
    N, K = map(int, input().split())
    
    seg = SegmentTree([0]*300010)
    ans = 0
    for _ in range(N):
        A = int(input())
        a = max(A-K, 0)
        b = min(A+K, 300000)
        tmp = seg.getmax(a, b) + 1
        ans = max(ans, tmp)
        seg.update(A, tmp)
    
    print(ans)


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

import numpy as np

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

ans = 0

for i in range(0, 1<<n):
    x = 0
    y = 0
    for j in range(n):
        if(i>>j&1):
            x = x + v[j]
            y = y + c[j]
    
    if(ans < x-y):
        ans = x - y

print(ans)

### FIXED CODE ###

import numpy as np

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

ans = 0

for i in range(n):
    if(v[i]-c[i]>0):
        ans += v[i] - c[i]

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

# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 25/07/2020

from sys import stdin,stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n, k = iia()
arr = iia()
tot = 1
for i in range(k):
    tot *= arr[i]

for i in range(k, n):
    cur = tot
    tot *= arr[i]
    tot //= arr[i - k]
    if tot > cur:
        print('Yes')
    else:
        print('No')
    

### FIXED CODE ###

# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 25/07/2020

from sys import stdin,stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n, k = iia()
arr = iia()
tot = 1
for i in range(k, n):
    if arr[i] > arr[i - k]:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

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

for j in range(min(k,45)):
  B = [0]*(n)
  for i in range(n):
    l = max(0,i-A[i])
    r = min(n-1,i+A[i])
    B[l] += 1
    if r+1 < n:
      B[r+1] -= 1  
      
  for i in range(1,n):
    B[i]+=B[i-1]
  
  A = B.copy()
print(*B)  

### FIXED CODE ###

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

for j in range(min(k,45)):
  B = [0]*(n)
  for i in range(n):
    l = max(0,i-A[i])
    r = min(n-1,i+A[i])
    B[l] += 1
    if r+1 < n:
      B[r+1] -= 1  
      
  for i in range(1,n):
    B[i]+=B[i-1]
  
  A = B.copy()
print(*B)
### BUGGY CODE ###

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

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

p_list = []
for ai, bi in zip(a, b):
    for i in range(bi):
        p_list.append(ai)

p_list.sort()

print(p_list[k-1])




### FIXED CODE ###

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

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

p_list = []
t = zip(a, b)
ts = sorted(t)
a, b = zip(*ts)
ans = 0
count = 0
for ai, bi in zip(a, b):
    count += bi
    if count >= k:
        ans = ai
        break

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

import sys
import math
input = sys.stdin.readline

def countdiv(n):
    i=1
    count = 0
    while i<=math.sqrt(n):
        if n%i==0:
            if n/i==i:
                count+=1
            else:
                count+=2
        i+=1
    return count

dp = [0]*int(1e7+1)
n=int(input())
Sum = 0
for i in range(1,n+1):
    val = countdiv(i)
    Sum+=i*val
print(Sum)



### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
ans = 0
for i in range(1,n+1):
    val = n//i
    total = (val*(val+1))//2
    ans += i*total
print(ans)