#include <bits/stdc++.h>
const int N = 1010;
const int M = 2010;
const long long MOD = 998244353;
using namespace std;
int n, k, a[N];
long long f[N][N], sum[N], ans = 0;
void READ() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
}
int GET(int x) {
  for (int i = 1; i <= n; i++) f[i][1] = 1;
  for (int j = 2; j <= k; j++) {
    for (int i = 1; i <= n; i++)
      f[i][j] = 0, sum[i] = (sum[i - 1] + f[i][j - 1]) % MOD;
    int r = 0;
    for (int i = 1; i <= n; i++) {
      while (r < i && a[i] - a[r + 1] >= x) r++;
      f[i][j] += sum[r];
      f[i][j] %= MOD;
    }
  }
  int res = 0;
  for (int i = 1; i <= n; i++) res = (res + f[i][k]) % MOD;
  return res;
}
int main() {
  READ();
  for (int i = (a[n] - a[1]) / (k - 1); i >= 1; i--) {
    ans += GET(i);
    ans %= MOD;
  }
  printf("%lld\n", ans);
  return 0;
}
