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