#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define ll long long
using namespace std;
inline ll read(){
    ll x=0,f=1;char ch=getchar();
    while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
    while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
    return x*f;
}
bool vis[200];
int main(){
    ll t=read(),n=read()-1;
    rep(i,1,100)vis[i*(100+t)/100]=1;
    int c=0;ll ans=0;
    rep(i,1,100+t){
        if(!vis[i]){
            if(c==n%t){
                ans=i;
            }
            c++;
        }
    }
    ans+=1ll*(100+t)*(n/t);
    cout<<ans<<endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,fma")

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cerr << #a << " = " << a << endl;

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}

template<typename T> void print(const T& a, ostream& out){	
	for(auto i: a) out << i << ' ';
	out << endl;
}

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

namespace IntModulo
{
	const int mod = 998244353;

	inline int add(int x, int y, int m = mod)
	{
		if (x + y < m)
			return x + y;
		return x + y - m;
	}

	inline int sub(int x, int y, int m = mod)
	{
		if (x >= y)
			return x - y;
		return x - y + m;
	}

	inline int mult(int x, int y, int m = mod)
	{
		return x * (LL) y % m;
	}

	inline int power(int x, LL y, int m = mod)
	{
		int r = 1;
		while(y)
		{
			if (y & 1)
				r = mult(r, x, m);
			x = mult(x, x, m);
			y >>= 1;
		}
		
		return r;
	}
	
	inline int inverse(int x, int m = mod)
	{
		return power(x, m - 2, m);
	}

	inline void ADD(int& x, int y, int m = mod){
		x += y;
		if (x >= m) x -= m;
	}

	inline void SUB(int& x, int y, int m = mod){
		x -= y;
		if (x < 0) x += m;
	}

	inline void MULT(int& x, int y, int m = mod){
		x = (x * (LL) y) % m;
	}
};

using namespace IntModulo;

const int N = 64;
int n, k, a[N][N], f[N];

int solve(vector<vector<int>>& g){
	int C = 0;
	vector<int> used(n, 0);

	function<void(int)> dfs = [&](int v){
		C++;
		used[v] = 1;
		for(auto i: g[v]){
			if (!used[i]){
				dfs(i);
			}
		}
	};

	vector<int> res;
	FOR(i, 0, n) if (!used[i]){
		dfs(i);
		res.PB(C);
		C = 0;
	}

	int ans = 1;
	for(auto i: res){
		MULT(ans, f[i]);
	}

	return ans;
}

int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	f[0] = 1;
	FOR(i, 1, N) f[i] = mult(f[i - 1], i);
	cin >> n >> k;
	FOR(i, 0, n) FOR(j, 0, n) cin >> a[i][j];
	vector<vector<int>> row(n), column(n);
	FOR(i, 0, n){
		FOR(j, 0, i){
			bool ok = true;
			FOR(x, 0, n){
				ok &= a[i][x] + a[j][x] <= k;
			}

			if (ok){
				row[i].PB(j);
				row[j].PB(i);
			}
		}
	}

	FOR(i, 0, n){
		FOR(j, 0, i){
			bool ok = true;
			FOR(x, 0, n){
				ok &= a[x][i] + a[x][j] <= k;
			}

			if (ok){
				column[i].PB(j);
				column[j].PB(i);
			}
		}
	}

	int R = solve(row);
	int C = solve(column);
	cout << mult(R, C) << endl;	
	
    cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
    return 0;
}
