#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 100;
const long long mod = 998244353;
long long dp[maxn][maxn];
int a[maxn];
int n, k;
int solve(int x) {
  dp[0][0] = 1;
  int l = 1;
  for (int i = 1; i <= n; ++i) {
    dp[i][0] = 1;
    for (int j = 1; j <= min(k, i); ++j) {
      while (l < i && a[i] - a[l] >= x) {
        ++l;
      }
      dp[i][j] = (dp[i - 1][j] + dp[l - 1][j - 1]) % mod;
    }
  }
  return dp[n][k];
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long ans = 0;
  for (int x = 1; x <= a[n] / (k - 1); ++x) {
    int tmp = solve(x);
    ans = (ans + tmp) % mod;
  }
  cout << ans << endl;
  return 0;
}
