#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
#pragma GCC optimize("O3")
using namespace std;
const int maxN = 1e3 + 2, mod = 998244353;
int n, k;
int a[maxN];
long long dp[maxN][maxN], pr[maxN][maxN], max_ind[maxN];
long long solve(int val) {
  int j = 0;
  for (int i = 0; i < int(n); i++) {
    while ((a[i] - a[j]) > val) j++;
    max_ind[i] = j - 1;
  }
  for (int i = 0; i < int(n); i++) {
    dp[1][i] = 1;
    pr[1][i] = i + 1;
  }
  for (int len = 2; len <= k; len++) pr[len][len - 2] = 0;
  for (int len = 2; len <= k; len++)
    for (int ind = len - 1; ind < n; ind++) {
      if (max_ind[ind] < 0)
        dp[len][ind] = 0;
      else
        dp[len][ind] = pr[len - 1][max_ind[ind]];
      pr[len][ind] = (pr[len][ind - 1] + dp[len][ind]) % mod;
    }
  long long ans = 0;
  for (int ind = k - 1; ind < n; ind++) {
    ans += dp[k][ind];
    ans %= mod;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 0; i < int(n); i++) cin >> a[i];
  sort(a, a + n);
  int maxD = a[n - 1] / (k - 1) + 1;
  long long ans = 0;
  for (int i = 0; i < int(maxD); i++) {
    ans += solve(i);
    ans %= mod;
  }
  cout << ans;
  return 0;
}
