#include <bits/stdc++.h>
using namespace std;
const int Maxk = 1005;
const int Maxn = 1005;
const int mod = 998244353;
int a[Maxn];
int n, k;
int dp[Maxk][Maxn];
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline int solve(int x) {
  for (int i = 0; i <= n; i++) dp[1][i] = i;
  for (int i = 2; i <= k; i++) {
    dp[i][0] = 0;
    int p = 0;
    for (int j = 1; j <= n; j++) {
      while (a[p + 1] + x <= a[j]) p++;
      dp[i][j] = add(dp[i][j - 1], dp[i - 1][p]);
    }
  }
  return dp[k][n];
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  int ans = 0;
  int d = (a[n] - a[1]);
  for (int i = 1; i * (k - 1) <= d; i++) ans = add(ans, solve(i));
  printf("%d\n", ans);
  return 0;
}
