#include <bits/stdc++.h>
static const int MAXN = 1e3 + 5;
static const int mod = 998244353;
using namespace std;
static int f[MAXN][MAXN], s[MAXN][MAXN];
static int a[MAXN], n, k, ans;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int x = 1; x <= (a[n] - a[1]) / (k - 1); ++x) {
    for (int i = 0; i <= n; ++i)
      for (int j = 0; j <= k; ++j) f[i][j] = s[i][j] = 0;
    for (int i = 1; i <= n; ++i) f[i][1] = 1, s[i][1] = i;
    for (int j = 2; j <= k; ++j) {
      int tot = 0;
      for (int i = 1; i <= n; ++i) {
        while (tot < i && a[i] - a[tot] >= x) tot++;
        if (tot && a[i] - a[tot] < x) tot--;
        f[i][j] = s[tot][j - 1];
        s[i][j] = (s[i - 1][j] + f[i][j]) % mod;
      }
    }
    ans = (ans + s[n][k]) % mod;
  }
  printf("%d", ans);
  return 0;
}
