#include <bits/stdc++.h>
using namespace std;
inline void solve();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  long long ans = 0;
  for (long long d = 1; d <= a[n - 1] / (k - 1); d++) {
    vector<long long> ndp(n), dp(n, 1);
    for (long long i = 2; i <= k; i++) {
      long long l = 0;
      long long sum = 0;
      for (long long j = 1; j < n; j++) {
        while (a[l] + d <= a[j]) {
          sum += dp[l];
          sum %= 998244353;
          l++;
        }
        ndp[j] = sum;
      }
      swap(ndp, dp);
      for (long long j = 0; j < n; j++) ndp[j] = 0;
    }
    for (long long j = 0; j < n; j++) {
      ans += dp[j];
      ans %= 998244353;
    }
  }
  cout << ans;
}
