#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << '\n'; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << ' ' << H;
  debug_out(T...);
}
const long long INF = 1e9;
const long long MOD = 998244353;
const int N = 1e3 + 5;
int n, k, A[N], DP[N][N];
int Solve(int x) {
  DP[0][0] = 1;
  for (int i = 1, p = 0; i <= n; i++) {
    while (A[i] - A[p + 1] >= x) p++;
    DP[i][0] = 1;
    for (int j = 1; j <= k; j++) DP[i][j] = (DP[i - 1][j] + DP[p][j - 1]) % MOD;
  }
  return DP[n][k];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  int mx = 0;
  for (int i = 1; i <= n; i++) cin >> A[i], mx = max(mx, A[i]);
  sort(A + 1, A + 1 + n);
  int ans = 0;
  for (int i = 1; i * (k - 1) <= mx; i++) ans = (ans + Solve(i)) % MOD;
  cout << ans << '\n';
  return 0;
}
