#include <bits/stdc++.h>
const int MAXN = 1005;
const int MOD = 998244353;
using namespace std;
int N, K, a[MAXN], cnt[100005];
int dp[MAXN][MAXN];
int do_dp_stuff(int dist) {
  for (int i = 0; i < N; i++) {
    dp[1][i] = 1;
  }
  for (int k = 2; k <= K; k++) {
    int ptr = N - 1, num = 0;
    for (int i = N - 1; i >= 0; i--) {
      while (ptr > i && a[ptr] - a[i] >= dist) {
        num = (num + dp[k - 1][ptr]) % MOD;
        ptr--;
      }
      dp[k][i] = num;
    }
  }
  int tot = 0;
  for (int i = 0; i < N; i++) {
    tot = (tot + dp[K][i]) % MOD;
  }
  return tot;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  int lim = (a[N - 1] - a[0]) / (K - 1), ans = 0;
  for (int i = 0; i <= lim + 1; i++) {
    cnt[i] = do_dp_stuff(i);
    if (i > 0) {
      ans = (ans + (long long)(i - 1) * (cnt[i - 1] - cnt[i])) % MOD;
    }
  }
  cout << ans << '\n';
  return 0;
}
