#include <bits/stdc++.h>
using namespace std;
int n, k, a[1000];
int dp[1000][1001];
int calc(int x) {
  int p = 0;
  dp[0][0] = dp[0][1] = 1;
  for (int i = 1; i < n; i++) {
    while (a[i] - a[p + 1] >= x) p++;
    dp[i][0] = 1;
    dp[i][1] = i + 1;
    for (int j = 2; j <= k; j++) {
      dp[i][j] = dp[i - 1][j];
      if (a[i] - a[p] >= x) dp[i][j] = (dp[i][j] + dp[p][j - 1]) % 998244353;
    }
  }
  return dp[n - 1][k];
}
int main(void) {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int maxi = a[n - 1] / (k - 1), ans = 0;
  for (int i = 1; i <= maxi; i++) ans = (ans + calc(i)) % 998244353;
  printf("%d\n", ans);
  return 0;
}
