#include <bits/stdc++.h>
int compare(const void *a, const void *b) {
  int ia = *(int *)a;
  int ib = *(int *)b;
  return ia - ib;
}
int main() {
  static int aa[1000], dp[1000];
  int n, k, x, h, i, j, ans;
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; i++) scanf("%d", &aa[i]);
  qsort(aa, n, sizeof *aa, compare);
  ans = 0;
  for (x = 1; x * (k - 1) <= aa[n - 1] - aa[0]; x++) {
    for (i = 0; i < n; i++) dp[i] = 1;
    for (h = 1; h < k; h++) {
      for (i = 1; i < n; i++) dp[i] = (dp[i] + dp[i - 1]) % 998244353;
      for (i = j = n - 1; j >= 0; j--) {
        while (i >= 0 && aa[j] - aa[i] < x) i--;
        dp[j] = i >= 0 ? dp[i] : 0;
      }
    }
    for (i = 0; i < n; i++) ans = (ans + dp[i]) % 998244353;
  }
  printf("%d\n", ans);
  return 0;
}
