#include <bits/stdc++.h>
using namespace std;
int n, k, ans;
const int N = 1010, mod = 998244353;
int a[N], f[N][N], s[N][N];
int suan(int x) {
  int res = 0;
  f[0][0] = s[0][0] = 1;
  for (int i = 1, now = 0; i <= n; ++i) {
    while (a[i] - a[now + 1] >= x) ++now;
    for (int j = 0; j <= k; ++j) {
      if (j) f[i][j] = s[now][j - 1];
      s[i][j] = (s[i - 1][j] + f[i][j]) % mod;
    }
    (res += f[i][k]) %= mod;
  }
  return res;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= a[n] / (k - 1); ++i) (ans += suan(i)) %= mod;
  cout << ans;
  return 0;
}
