#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000;
const int Mod = 998244353;
int N, K, A[Maxn + 5];
long long f[Maxn + 5][Maxn + 5];
int Solve(int x) {
  f[0][0] = 1;
  int last = 0;
  for (int i = 1; i <= N; i++) {
    while (last + 1 <= i && A[i] - A[last + 1] >= x) last++;
    for (int j = 0; j <= K; j++) f[i][j] = f[i - 1][j];
    for (int j = 1; j <= K; j++) f[i][j] = (f[i][j] + f[last][j - 1]) % Mod;
  }
  return f[N][K];
}
int main() {
  scanf("%d %d", &N, &K);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  sort(A + 1, A + N + 1);
  long long ans = 0;
  for (int i = 1; i * (K - 1) <= A[N]; i++) ans = (ans + Solve(i)) % Mod;
  printf("%lld\n", ans);
  return 0;
}
