#include <bits/stdc++.h>
using namespace std;
const int p = 998244353;
const int N = 1005;
int a[N], f[N][N], s[N * 100];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  int lim = (a[n] - a[1]) / (k - 1);
  for (int v = 1; v <= lim; v++) {
    for (int i = 0; i <= n; i++)
      for (int j = 1; j <= k; j++) f[i][j] = 0;
    for (int i = 1, j = 0; i <= n; i++) {
      while (j + 1 < i && a[i] - a[j + 1] >= v) j++;
      f[i][1] = f[i - 1][1] + 1;
      for (int t = 2; t <= k; t++) f[i][t] = (f[j][t - 1] + f[i - 1][t]) % p;
    }
    s[v] = f[n][k];
  }
  int ans = 0;
  for (int v = 1; v <= lim; v++)
    (ans += (long long)v * (s[v] - s[v + 1] + p) % p) %= p;
  printf("%d\n", ans);
  return 0;
}
