#include <bits/stdc++.h>
using namespace std;
int f[1005][1005], s[1005][1005];
int n, k, a[1005], ans;
inline int X(int x) {
  for (int i = 1; i <= k; i++)
    for (int j = 1; j <= n; j++) f[i][j] = s[i][j] = 0;
  for (int i = 1; i <= n; i++) f[1][i] = 1;
  for (int i = 1; i <= k; i++) {
    int l = 1;
    for (int j = 1; j <= n; j++) {
      while (a[j] - a[l] >= x) l++;
      f[i][j] = (f[i][j] + s[i - 1][l - 1]) % 998244353;
      s[i][j] = (f[i][j] + s[i][j - 1]) % 998244353;
    }
  }
  int ret = 0;
  for (int i = k; i <= n; i++) (ret += f[k][i]) %= 998244353;
  return ret;
}
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 i = 1; i <= (a[n]) / (k - 1); i++) (ans += X(i)) %= 998244353;
  printf("%d\n", ans);
}
