#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VL = vector<ll>;
using VI = vector<int>;
const ll MOD = 998244353;
inline void suma(ll& x, ll y) { x = (x + y) % MOD; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  VI A(n);
  for (int& a : A) cin >> a;
  A.push_back(-1e9);
  sort(A.begin(), A.end());
  ll res = 0;
  int mx = A[n] / (k - 1);
  VI ini(n + 1, n);
  for (int b = 1; b <= mx; ++b) {
    for (int j = 1; j <= n; ++j)
      while (A[ini[j]] + b > A[j]) --ini[j];
    VL pre1(n + 1, 0);
    for (int j = 1; j <= n; ++j) pre1[j] = j;
    for (int i = 2; i <= k; ++i) {
      VL pre2(n + 1, 0);
      for (int j = i; j <= n; ++j) suma(pre2[j], pre2[j - 1] + pre1[ini[j]]);
      swap(pre1, pre2);
    }
    suma(res, pre1[n]);
  }
  cout << res << endl;
}
