#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 998244353;
template <typename S, typename T>
inline bool Min(S &a, const T &b) {
  return a > b ? a = b, true : false;
}
template <typename S, typename T>
inline bool Max(S &a, const T &b) {
  return a < b ? a = b, true : false;
}
template <typename S, typename T>
inline void Adm(S &a, const T &b) {
  a = (a + b) % MOD;
  if (a < 0) a += MOD;
}
template <typename S, typename T>
inline void Mum(S &a, const T &b) {
  a = a * b % MOD;
}
inline long long Mum(initializer_list<long long> ls) {
  long long a = 1;
  for (long long b : ls) a = a * b % MOD;
  return a;
}
const int N = 1e3 + 100;
int a[N], n, k;
long long f[N][N], g[100010];
long long dp(int x) {
  for (int i = 0; i <= n + 5; ++i)
    for (int j = 0; j <= k; ++j) f[i][j] = 0;
  f[0][0] = 1;
  int p = 0;
  for (int i = 1; i <= n; ++i) {
    while (p + 1 < i && a[i] - a[p + 1] >= x) ++p;
    for (int j = 1; j <= k; ++j) Adm(f[i][j], f[p][j - 1]);
    for (int j = 0; j <= k; ++j) Adm(f[i][j], f[i - 1][j]);
  }
  return f[n][k];
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  long long ans = 0;
  for (int i = 100000 / (k - 1); i >= 1; --i) {
    g[i] = dp(i);
    Adm(ans, (g[i] - g[i + 1]) * i);
  }
  cout << ans << endl;
  return 0;
}
