#include <bits/stdc++.h>
using namespace std;
constexpr int mod = 998244353;
int n, k;
long long a[1005], dp[1005][1005], pref[1005][1005];
long long beauty(int x) {
  for (int i = 0; i <= n; i++) pref[i][0] = 1;
  int p = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= k; j++) {
      while (a[i] - a[p + 1] >= x) p++;
      dp[i][j] = pref[p][j - 1];
      pref[i][j] = (pref[i - 1][j] + dp[i][j]) % mod;
    }
  return pref[n][k];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long ans = 0;
  for (long long i = 1; i <= 1e5 / (k - 1); i++)
    ans = (ans + i * (beauty(i) - beauty(i + 1))) % mod;
  cout << ans << "\n";
  return 0;
}
