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

from sys import stdin
import math
import fractions

a, b, n = [int(x) for x in stdin.readline().rstrip().split()]

r = -100
for i in range(b):
    if (i > n):
        break
    if (r < (a * i / b)):
        r = a * i / b

print(int(r))

### FIXED CODE ###

from sys import stdin
import math
import fractions

a, b, n = [int(x) for x in stdin.readline().rstrip().split()]

if (b > n):
    print(int(a * n / b))
else:
    print(int(a * (b - 1) / b))
### BUGGY CODE ###

import sys
import itertools

readInt = lambda : [int(i) for i in input().split()];
n = readInt()[0]
A = readInt()

B = list(itertools.accumulate(A))

cand = []
for i in range(2, len(A)-1):
  B0 = B[0:i]
  B1 = [x - B[i-1] for x in B[i:len(A)]]
  D0 = [abs(2 * x - B0[-1]) for x in B0]
  D1 = [abs(2 * x - B1[-1]) for x in B1]
  j0 = D0.index(min(D0))
  j1 = D1.index(min(D1))
  c = [B0[j0], B0[-1] - B0[j0], B1[j1], B1[-1] - B1[j1]]
  cand.append(max(c) - min(c))

ans = min(cand)
print(ans)

### FIXED CODE ###

import sys
import itertools
import bisect

readInt = lambda : [int(i) for i in input().split()];
n = readInt()[0]
A = readInt()

B = list(itertools.accumulate(A))

cand = 2 * pow(10, 14)
for i in range(2, len(A)-1):
  z = B[i-1]
  s = z // 2
  j = bisect.bisect_right(B, s)
  if (j == 0):
    j0 = j
  else:
    c0 = abs(2 * B[j-1] - z)
    c1 = abs(2 * B[j] - z)
    j0 = j-1 if c0 < c1 else j

  z = B[-1]
  s = B[i-1] + (B[-1] - B[i-1]) // 2
  j = bisect.bisect_right(B, s)
  if (j == i):
    j1 = j
  else:
    c0 = abs(B[j-1] - B[i-1] - (B[-1] - B[j-1]))
    c1 = abs(B[j]   - B[i-1] - (B[-1] - B[j]  ))
    j1 = j-1 if c0 < c1 else j

  c = [B[j0], B[i-1] - B[j0], B[j1] - B[i-1], B[-1] - B[j1]]
  cand = min(cand, max(c) - min(c))

ans = cand
print(ans)
### BUGGY CODE ###

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

s = 1
for i in a:
    s *= i
    if i > 10 ** 18:
        print(-1)
        exit()
if s > 10 ** 18:
    print(-1)
else:
    print(s)

### FIXED CODE ###

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

s = 1
l=10**18

for i in a:
    s *= i
    if s > l:
        print(-1)
        exit()
print(s)
### BUGGY CODE ###

from collections import deque

def solve(H, W, s):
    scores = [[float('inf') for _ in range(W)] for _ in range(H)]
    stack = deque()
    if s[0][0] == '.':
        scores[0][0] = 0
        stack.append([(0, 0), [(0, 0)]])
    else:
        scores[0][0] = 1
        stack.append([(0, 0), [(1, 0), (0, 1)]])

    while stack:
        (x, y), diff = stack.popleft()
        for next_x, next_y in [(x + 1, y), (x, y + 1)]:
            if not (next_x < H and next_y < W):
                continue
            if s[next_x][next_y] == '.':
                scores[next_x][next_y] = min(scores[next_x][next_y], scores[x][y])
                stack.append([(next_x, next_y), [(0, 0)]])
            elif (next_x - x, next_y - y) in diff:
                scores[next_x][next_y] = min(scores[next_x][next_y], scores[x][y])
                stack.append([(next_x, next_y), [(next_x - x, next_y - y)]])
            else:
                scores[next_x][next_y] = min(scores[next_x][next_y], scores[x][y] + 1)
                stack.append([(next_x, next_y), [(next_x - x, next_y - y)]])

    return scores[H - 1][W - 1]

if __name__ == '__main__':
    H, W = map(int, input().split())
    s = []
    for _ in range(H):
        s.append(list(input()))

    print(solve(H, W, s))


### FIXED CODE ###

def solve(H, W, s):
    scores = [[float('inf') for _ in range(W)] for _ in range(H)]
    scores[0][0] = 0 if s[0][0] == '.' else 1

    for i in range(H):
        for j in range(W):
            for x, y in [(i - 1, j), (i, j - 1)]:
                if x < 0 or y < 0:
                    continue
                if s[i][j] == '.' or s[x][y] == '#':
                    scores[i][j] = min(scores[i][j], scores[x][y])
                else:
                    scores[i][j] = min(scores[i][j], scores[x][y] + 1)

    return scores[H - 1][W - 1]

if __name__ == '__main__':
    H, W = map(int, input().split())
    s = []
    for _ in range(H):
        s.append(list(input()))

    print(solve(H, W, s))
### BUGGY CODE ###

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

def factorial(n):
    v = 1
    for i in range(1, n + 1):
        v *= i
    return v

def comb(a, b):
    return factorial(a) // (factorial(b) * factorial(a - b))

from collections import Counter
acnt = dict(Counter(a))
value = list(acnt.values())
sv = 0
for i in range(len(value)):
    if value[i] > 1:
        sv += comb(value[i], 2)
for i in range(n):
    cur = a[i]
    cursv = sv
    if acnt[cur] > 2:
        cursv = cursv - comb(acnt[cur], 2) + comb(acnt[cur] - 1, 2)
    elif acnt[cur] == 2:
        cursv -= 1
    print(cursv)


### FIXED CODE ###

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

def factorial(n):
    v = 1
    for i in range(1, n + 1):
        v *= i
    return v

def comb(a, b):
    return factorial(a) // (factorial(b) * factorial(a - b))

from collections import Counter
acnt = dict(Counter(a))
value = list(acnt.values())
sv = 0
for i in range(len(value)):
    if value[i] > 1:
        sv += (value[i]*(value[i]-1))//2
for i in range(n):
    cur = a[i]
    cursv = sv
    if acnt[cur] > 2:
        cursv = cursv - acnt[cur] + 1
    elif acnt[cur] == 2:
        cursv -= 1
    print(cursv)
### BUGGY CODE ###

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

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect

# 再起回数上限変更
# sys.setrecursionlimit(1000000)


class Warshall(object):
    def __init__(self, n:int):
        self.cost = [[float('inf')] * n for _ in range(n)]

        self.n = n
        for i in range(n):
            self.cost[i][i] = 0

    def add_edge(self, v1: int, v2: int, w: float, undirected=False):
        self.cost[v1][v2] = w
        if undirected:
            self.cost[v2][v1] = w

    def run(self):
        for k in range(N):
            for i in range(N):
                for j in range(N):
                    self.cost[i][j] = min(
                        self.cost[i][j],
                        self.cost[i][k] + self.cost[k][j]
                    )


if __name__ == '__main__':
    N, M, L = map(int, input().split())

    g = Warshall(N)
    g2 = Warshall(N)
    for _ in range(M):
        v1, v2, w = map(int, input().split())
        if w <= L:
            g.add_edge(v1 - 1, v2 - 1, w, undirected=True)
    g.run()

    for i in range(N):
        for j in range(N):
            if g.cost[i][j] <= L:
                g2.cost[i][j] = 1
    g2.run()

    q = int(input())
    for _ in range(q):
        s, t = map(int, input().split())
        ans = g2.cost[s-1][t-1]
        if ans == float('inf'):
            print(-1)
        else:
            print(ans - 1)


### FIXED CODE ###

import sys
input = sys.stdin.readline
 
n, m, l = map(int, input().split())
 
INF = float("INF")
 
d = [[INF] * n for _ in range(n)]
for i in range(n):
    d[i][i] = 0
 
for i in range(m):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    d[a][b] = c
    d[b][a] = c
 
for k in range(n):
    for i in range(n):
        for j in range(n):
            if d[i][j] > d[i][k] + d[k][j]:
                d[i][j] = d[i][k] + d[k][j]
 
# print()
# print(*d, sep='\n')
 
for i in range(n):
    for j in range(n):
        if i == j:
            continue
 
        if d[i][j] <= l:
            d[i][j] = 1
        else:
            d[i][j] = INF
 
for k in range(n):
    for i in range(n):
        for j in range(n):
            if d[i][j] > d[i][k] + d[k][j]:
                d[i][j] = d[i][k] + d[k][j]
 
# print()
# print(*d, sep='\n')
 
q = int(input())
for i in range(q):
    s, t = map(int, input().split())
    s -= 1
    t -= 1
 
    if d[s][t] == INF:
        print(-1)
    else:
        print(d[s][t]-1)
### BUGGY CODE ###

N = int(input())
CSF = []
for i in range(N-1):
    CSF.append(list(map(int,input().split())))
def time(t,i):
    if CSF[i][1] >= t:
        return CSF[i][1]+CSF[i][0]
    else:
        x = 1
        while t > CSF[i][1]+ x*CSF[i][2]:
            x += 1
        return CSF[i][1]+ x*CSF[i][2] + CSF[i][0]

for i in range(N-1):
    t = CSF[i][0]+CSF[i][1]
    for j in range(i+1,N-1):
        t = time(t,j)
    print(t)

print(0)

### FIXED CODE ###

N = int(input())
CSF = []
import math
for i in range(N-1):
    CSF.append(list(map(int,input().split())))
def time(t,i):
    if CSF[i][1] >= t:
        return CSF[i][1]+CSF[i][0]
    else:
        x = math.ceil((t-CSF[i][1])/CSF[i][2])
        return CSF[i][1]+ x*CSF[i][2] + CSF[i][0]

for i in range(N-1):
    t = CSF[i][0]+CSF[i][1]
    for j in range(i+1,N-1):
        t = time(t,j)
    print(t)

print(0)
### BUGGY CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
for i in range(M):
    B,C=map(int,input().split())
    for j in range (B):
        if A[j]<C:
            A[j]=C
        else:
            break
    A.sort()

print(sum(A))

### FIXED CODE ###

import numpy as np


N,M=map(int,input().split())
# A=np.array(list(map(int,input().split())))
A=np.array(list(map(int,input().split())),dtype=np.int32)
A=np.sort(A)

EXC=[]

for i in range(M):
    exc=list(map(int,input().split()))
    EXC.append(exc)
excArry=np.array(EXC,dtype=np.int32)

col_num=1
Arr=excArry[np.argsort(excArry[:,col_num])[::-1]]
# print(A)
# print(Arr)

point=0


for j in range (M):
    change_Num=Arr[j][1]
    count=np.count_nonzero(A<change_Num)
    if count > 0:
        m=min(count,Arr[j][0])
        A[point:point+m]=change_Num
        point+=m
        # A=np.sort(A)
    else:
        break

print(np.sum(A))
    
#     for j in range (B):
#         count=np.count_nonzero(A<C)
#         if count>0:
#             m=min(B,count)
#             A[:m]=C
#         else:
#             continue
    
#     A=np.sort(A)

# print(np.sum(A))
### BUGGY CODE ###

n,m=map(int,input().split())
item=list(map(int,input().split()))
for i in range(m):
    item=sorted(item)
    item[-1]=item[-1]//2

print(sum(item))

### FIXED CODE ###

import heapq
n,m=map(int,input().split())
item=list(map(lambda x: -int(x),input().split()))
heapq.heapify(item)
for i in range(m):
    a=-heapq.heappop(item)
    a //=2
    heapq.heappush(item,-a)

print(-sum(item))
### BUGGY CODE ###

#n以下の素数列挙(O(n log(n))
def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass


mod = 10**9+7
n = int(input())
a = tuple(map(int,input().split()))

pr = primes(10**6+1)

d = dict()

for elt in a:
    for p in pr:
        if elt < p:
            break
        c = 0
        while not elt%p:
            c += 1
            elt //= p
        if p in d:
            if c > d[p]:d[p] = c
        else:
            d[p] = c


lcm  = 1
for elt in d:
    lcm = lcm*pow(elt,d[elt],mod)%mod

res = 0
for e in a:
    res = (res + pow(e,mod-2,mod))%mod
print(res*lcm%mod)



### FIXED CODE ###

#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

#a,bの最小公倍数
def lcm(a, b):
	return a * b // gcd (a, b)


mod = 10**9+7
n = int(input())
a = list(map(int,input().split()))

l = a[0]
for e in a:
    l = lcm(l,e)

a_sum = 0
for e in a:
    a_sum = (a_sum + pow(e,mod-2,mod))%mod

print((l%mod)*a_sum%mod)
### BUGGY CODE ###

N=int(input())
A=list(map(int, input().split()))
A=sorted(A)
s=0
for num in range(1, N+1):
  count = 0
  for i in range(s, N-1):
    if A[i] == num:
      count += 1
  s+=count
  print(count)

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
A=sorted(A)
s=0
for num in range(1, N+1):
  count = 0
  for i in range(s, N-1):
    if A[i] == num:
      count += 1
    else:
      break
  s+=count
  print(count)
### BUGGY CODE ###

#200802C
X = int(input())
L = len(str(X))
#print(L)


Y = 0

for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(10000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)

        


### FIXED CODE ###

#200802C
X = int(input())
L = len(str(X))
#print(L)


Y = 0

for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(1000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)
### BUGGY CODE ###

from collections import defaultdict
s = input()
t = input()
d = defaultdict(set)
e = defaultdict(set)
for i in range(len(s)):
    d[s[i]].add(i)
    e[t[i]].add(i)
ans = True
for i in range(len(s)):
    if e[t[i]] != d[s[i]]:
        ans = False
print("Yes" if ans else "No")

### FIXED CODE ###

from collections import defaultdict
s = input()
t = input()
d = defaultdict(str)
e = defaultdict(str)
for i in range(len(s)):
    c1,c2 = s[i],t[i]
    if d[c1] == "":
        d[c1] = c2
    elif d[c1] != c2:
        print("No")
        exit(0)
    if e[c2] == "":
        e[c2] = c1
    elif e[c2] != c1:
        print("No")
        exit(0)
print("Yes")
### BUGGY CODE ###

from math import factorial
N = int(input())
s = ["".join(sorted(list(input()))) for i in range(N)]
tmp = list(set(s))
for i in range(len(tmp)):
    s.remove(tmp[i])
tmp = list(set(s))
countlist = []
for i in range(len(tmp)):
    counter = 1
    for j in range(len(s)):
        if tmp[i] == s[j]:
            counter += 1
    countlist.append(counter)
ans = 0
if countlist == []:
    print(0)
else:
    for i in range(len(countlist)):
        if countlist[i] == 2:
            ans += 1
        else:
            ans += factorial(countlist[i])//(factorial(countlist[i]-2)*2)
    print(ans)

### FIXED CODE ###

N = int(input())
s = {}
ans = 0
for i in range(N):
    a = "".join(sorted(input()))
    if a not in s:
        s.setdefault(a,0)
    else:
        s[a] += 1
        ans += s[a]
print(ans)
### BUGGY CODE ###

from collections import deque
# 木構造を作る
N,Q  = map(int, input().split())

G = [[] for i in range(N)]
for i in range(N-1):
    # グラフに頂点を追加(距離があるときは,u,vの後に入れる)
    u,v = map(int,input().split())
    G[u-1].append((v-1))
    G[v-1].append((u-1))



## クエリを持っておく
scores = [0]*N
for i in range(Q):
    p,x = map(int, input().split())
    scores[p-1] += x 

# print(scores)

ans = [0]*N
# DFSするよ
ans[0] = scores[0]
import sys
sys.setrecursionlimit(100000)
used = [False] * N
def dfs(G, v):
   # vを訪問済みにする
   used[v] = True
   #グラフ中の次のVについて
   for next_v in G[v]:
       # すでに見られていたら無視
       if used[next_v]: continue
       # 見られていない場合、再帰的に探索
       ### なにかやりたい処理を書く
       ans[next_v] = ans[v] + scores[next_v]
       dfs(G, next_v)

dfs(G,0)
print(*ans)


### FIXED CODE ###


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

# 木
G = [[] for i in range(N)]
for i in range(N-1):
    u,v = map(int,input().split())
    G[u-1].append((v-1))
    G[v-1].append((u-1))

## クエリを覚えておく
scores = [0]*N
for i in range(Q):
    p,x = map(int, input().split())
    scores[p-1] += x 

# 和をとっていく
ans = [0]*N
ans[0] = scores[0]
used = [False] * N

"""
dfs TLEする。なんで
"""
# import sys
# sys.setrecursionlimit(100000)
# def dfs(G, v):
#    # vを訪問済みにする
#    used[v] = True
#    #グラフ中の次のVについて
#    for next_v in G[v]:
#        if used[next_v]: continue
#        ans[next_v] = ans[v] + scores[next_v]
#        dfs(G, next_v)
# dfs(G,0)
# print(*ans)

# 木をBFSをする
from collections import deque
used = [False] * N
used[0] = True # 始めどこから行くか
q = deque([0])
while len(q) > 0:
    v = q.popleft()
    Vs = G[v]
    for next_v in Vs: 
        if not used[next_v]:
            q.append(next_v)
            ans[next_v] = ans[v] + scores[next_v]
            used[next_v] = True
print(*ans)
### BUGGY CODE ###

# coding: utf-8
# Here your code !




def main(N,k):
    p = 0
    for i in range(N-1):
        p2 = p
        while p2-1-p2//k != p:
            p2+=1
        p=p2
    return p




if __name__ == '__main__':
    N,k=input().split()
    print(main(int(N),int(k)))

### FIXED CODE ###

# coding: utf-8
# Here your code !

def main(N,k):
    p = 0
    p2 = 0
    memo = 0
    for i in range(N-1):
        p, p2 = p2, k*(p2+1)//(k-1) - 2
        while p2-1-p2//k != p:
            p2+=1
    return p2

if __name__ == '__main__':
    N,k=input().split()
    print(main(int(N),int(k)))
### BUGGY CODE ###

n = int(input())

s = []
for i in range(n):
    s.append(input())

cnt = 0
for i in range(n):
    for j in range(i+1,n):
        if i == j:
            pass
        else:
            #print(i,j)
            a1 = list(s[i])
            b1 = list(s[j])

            a1.sort()
            b1.sort()

            a2 = "".join(a1)
            b2 = "".join(b1)

            if a2 == b2:
                cnt += 1

print(cnt)


### FIXED CODE ###

n = int(input())

s = []
for i in range(n):
    tmp = []
    tmp = list(input())
    tmp.sort()
    s.append("".join(tmp))

s.sort()

cnt = 0
t_cnt = 0
for i in range(n-1):
    if s[i] == s[i+1]:
        t_cnt += 1
    elif s[i] != s[i+1]:
        if t_cnt > 1:
            t_cnt += 1

            t = 0
            for j in range(t_cnt):
                t += j

            cnt += t
            t_cnt = 0
        else:
            cnt += t_cnt
            t_cnt = 0

    if i == n-2:

        if t_cnt > 1:
            t_cnt += 1

            t = 0
            for j in range(t_cnt):
                t += j

            cnt += t
            t_cnt = 0
        else:
            cnt += t_cnt
            t_cnt = 0

print(cnt)
### BUGGY CODE ###

n,p = map(int,input().split())
if n == 1:
    print(p)
    exit()
q = int(p**(1/n))+1
i =q
while q>0:
    if p%(q**n)==0:
        print(q)
        exit()
    else:
        q -= 1
print(1)

### FIXED CODE ###

n,p = map(int,input().split())
if n == 1:
    print(p)
    exit()
if n >=40:
    print(1)
    exit()
i =2
ans =1
while i**n <= p:
    if p%(i**n)==0:
        ans *= i
        p =p//(i**n)

    else:
        i += 1
print(ans)
### BUGGY CODE ###

INF = float("INF")
n,m = map(int,input().split())
A = [0]*m
C = [0]*m
for i in range(m):
    a,b = map(int,input().split())
    A[i] = a
    for j in map(int,input().split()):
        j -= 1
        C[i] += 1<<j 

dp = [[INF]*(m+1) for _ in range(1<<n)]
dp[0][0] = 0
for i in range(1<<n):
    for j in range(m):
        dp[i][j+1] = min(dp[i][j],dp[C[j]&i^i][j] + A[j])

# for i in range(1<<n): print(dp[i])
print(dp[-1][-1] if dp[-1][-1] != INF else -1)

### FIXED CODE ###

INF = float("INF")
n,m = map(int,input().split())
A = [0]*m
C = [0]*m
for i in range(m):
    a,b = map(int,input().split())
    A[i] = a
    for j in map(int,input().split()):
        j -= 1
        C[i] += 1<<j 

dp = [[INF]*(m+1) for _ in range(1<<n)]
dp[0][0] = 0
for i in range(1<<n):
    for j in range(m):
        dp[i][j+1] = min(dp[i][j],dp[C[j]&i^i][j] + A[j])

# for i in range(1<<n): print(dp[i])
print(dp[-1][-1] if dp[-1][-1] != INF else -1)
### BUGGY CODE ###

import re
n,q = map(int, input().split())
s = input()
l = [0]*q
r = [0]*q
counts = [0]*n

pattern = "AC"
result = re.finditer(pattern, s)
for res in result:
  counts[res.start()] = 1

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

### FIXED CODE ###

n,q = map(int, input().split())
s = input()

counts = [1 if s[i:i+2]=="AC" else 0 for i in range(n)]

cum_counts=[0]*n
for i in range(1,n):
  cum_counts[i]=cum_counts[i-1]+counts[i-1]

#print(counts)
#print(cum_counts)

for i in range(q):
  l,r = map(int, input().split())
  print(cum_counts[r-1] - cum_counts[l-1])
### BUGGY CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string



INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 998244353


n, m = LI()
total = m * 3


fac = [1] * (total + n)
inv = [1] * (total + n)
i = 1
for j in range(1, total + n):
    i = i * j % mod
    fac[j] = i
    inv[j] = pow(i, mod - 2, mod)



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



ans = comb(total + n - 1, n - 1)
for i in range(m + 2, min(n + 1, total + 1)):
    if (total - i) % 2 == 0:
        ans -= comb(n, i) * comb(n + (total - i) // 2 - 1, n - 1) % mod
        ans %= mod


ret = 0
for i in range(m):
    ret = (ret + comb(i + n - 2, n - 2)) % mod


ans -= (ret * n) % mod
print(ans % mod)

### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string



INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 998244353


n, m = LI()
total = m * 3

fac = [1] * (total+n+1)
inv = [1] * (total+n+1)
for i in range(total+n):
    fac[i+1] = fac[i]*(i+1)%mod

inv[total+n]=pow(fac[-1], mod-2, mod)
for j in range(total+n-1, -1, -1):
    inv[j]=inv[j+1]*(j+1)%mod



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


ans = comb(total+n-1, n-1)
for i in range(m + 2, min(n + 1, total + 1)):
    if (total - i) % 2 == 0:
        ans -= comb(n, i) * comb(n + (total - i) // 2 - 1, n - 1) % mod
        ans %= mod


ret = 0
for i in range(m):
    ret = (ret + comb(i + n - 2, n - 2)) % mod


ans -= (ret * n) % mod
print(ans % mod)
### BUGGY CODE ###

n = int(input())
l = sorted(map(int, input().split()))

ans = 0
for i in range(n):
    for j in range(i+1, n):
        big = l[i]+l[j]
    
        ch_max = n
        ch_min = j+1
        
        while ch_min < ch_max:
            ch_i = (ch_min + ch_max) // 2
            if l[ch_i] < big:
                ch_min = ch_i + 1
            else:
                ch_max = ch_i
                
        big_i = ch_max
        
        ans += big_i - (j + 1)
                
print(ans)

### FIXED CODE ###

n = int(input())
l = sorted(map(int, input().split()))
 
ans = 0
for i in range(n):
    for j in range(i+1, n):
        big = l[i]+l[j]
    
        ch_max = n
        ch_min = j+1
        
        while ch_min < ch_max:
            ch_i = (ch_min + ch_max) // 2
            if l[ch_i] < big:
                ch_min = ch_i + 1
            else:
                ch_max = ch_i
                
        big_i = ch_max
        
        ans += big_i - (j + 1)
                
print(ans)
### BUGGY CODE ###

N = int(input())
for n in range(1,N+1):
    if n < 6:
        print(0)
    else:
        M =int((n-2)**0.5)
        count = 0
        for x in range(1,M+1):
            for y in range(1,M+1):
                for z in range(1,M+1):
                    if x**2+y**2+z**2+x*y+y*z+z*x == n:
                        count = count + 1
                    else:
                        pass
        print(count)


### FIXED CODE ###

N = int(input())
lst = [0]*(N+1)

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            p = (x+y)*(x+z)+y**2+z**2
            if p > N:
                break
            else:
                lst[p] += 1
for i in range(1,N+1):
    print(lst[i])