Pagini recente » Cod sursa (job #1988003) | Cod sursa (job #2505753) | Cod sursa (job #2143460) | Cod sursa (job #2526171) | Cod sursa (job #3317264)
/*
_____ _____ _______
/\ \ /\ \ /::\ \
/::\____\ /::\ \ /::::\ \
/:::/ / /::::\ \ /::::::\ \
/:::/ / /::::::\ \ /::::::::\ \
/:::/ / /:::/\:::\ \ /:::/~~\:::\ \
/:::/ / /:::/__\:::\ \ /:::/ \:::\ \
/:::/ / /::::\ \:::\ \ /:::/ / \:::\ \
/:::/ / _____ /::::::\ \:::\ \ /:::/____/ \:::\____\
/:::/____/ /\ \ /:::/\:::\ \:::\ \ ::: | |:::| |
|:::| / /::\____\ /:::/ \:::\ \:::\____\ |:::|____| |:::| |
|:::|____\ /:::/ / \::/ \:::\ /:::/ / \:::\ \ /:::/ /
\:::\ \ /:::/ / \/____/ \:::\/:::/ / \:::\ \ /:::/ /
\:::\ \ /:::/ / \::::::/ / \:::\ /:::/ /
\:::\ /:::/ / \::::/ / \:::\__/:::/ /
\:::\__/:::/ / /:::/ / \::::::::/ /
\::::::::/ / /:::/ / \::::::/ /
\::::::/ / /:::/ / \::::/ /
\::::/ / /:::/ / \::/____/
\::/____/ \::/ / ~~
~~ \/____/
*/
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ins(x) insert(x)
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fast_ios ios_base::sync_with_stdio(0),cin.tie(nullptr),cout.tie(nullptr);
#define all(v) (v).begin() , (v).end()
using namespace std;
ifstream fin ( "stirling.in" ) ;
ofstream fout ( "stirling.out" ) ;
ll nxt()
{
ll x;
fin >> x ;
return x;
}
void close_files()
{
fin.close();
fout.close();
}
const int mod = 98999;
ll s[205][205];
ll S[205][205];
signed main()
{
fast_ios
ll p;
fin >> p ;
s[1][1]=S[1][1]=1;
for ( ll i = 2 ; i <= 200 ; ++ i )
for ( ll j = 1 ; j <= i ; ++ j )
{
S[i][j] = (S[i-1][j-1] + 1LL*j*S[i-1][j]) %mod;
s[i][j] = (s[i-1][j-1] - 1LL*( i - 1 ) * s[i-1][j]) %mod;
}
while ( p -- )
{
ll x , n , m ;
fin >> x >> n >> m;
if ( x == 1 )
fout << s[n][m] << '\n';
else
fout << S[n][m] << '\n';
}
close_files();
return 0;
}