#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  vector<int> a((size_t)n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int m = *max_element(a.begin(), a.end());
  sort(a.begin(), a.end());
  int o = 0;
  for (int x = 1; x <= m / (k - 1) + 1; x++) {
    vector<vector<int>> dp((size_t)k + 1, vector<int>((size_t)n, 0));
    vector<vector<int>> ep((size_t)k + 1, vector<int>((size_t)n, 0));
    int r = 0;
    for (int i = 0; i < n; i++) {
      while (r < i && a[i] >= a[r] + x) {
        r++;
      }
      for (int j = 1; j <= k; j++) {
        if (j == 1) {
          dp[j][i] = 1;
        } else {
          dp[j][i] += r == 0 ? 0 : ep[j - 1][r - 1];
        }
        dp[j][i] %= 998244353;
        ep[j][i] = (i == 0 ? 0 : ep[j][i - 1]) + dp[j][i];
        ep[j][i] %= 998244353;
      }
    }
    o += ep[k][n - 1];
    o %= 998244353;
  }
  cout << o << endl;
  return 0;
}
