#include <bits/stdc++.h>
using namespace std;
int n, k;
int values[1013];
int dp[1013][1013];
int prefix[1013][1013];
int main() {
  if (fopen("FILENAME.in", "r")) {
    freopen("FILENAME.in", "r", stdin);
    freopen("FILENAME.out", "w", stdout);
  }
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> values[i];
  }
  sort(values, values + n);
  int answer = 0;
  for (int beauty = 1; beauty * (k - 1) <= 100010; beauty++) {
    for (int i = 0; i <= n; i++) {
      for (int j = 0; j <= k; j++) {
        dp[i][j] = 0;
        prefix[i][j] = 0;
      }
    }
    for (int i = 0; i < n; i++) {
      dp[i][1] = 1;
      prefix[i + 1][1] = prefix[i][1] + 1;
    }
    int bound = 0;
    for (int i = 1; i < n; i++) {
      while (abs(values[bound] - values[i]) >= beauty) {
        bound++;
      }
      bound--;
      if (abs(values[0] - values[i]) < beauty) {
        for (int j = 2; j <= k; j++) {
          prefix[i + 1][j] += prefix[i][j];
        }
        continue;
      }
      for (int j = 2; j <= k; j++) {
        dp[i][j] += prefix[bound + 1][j - 1];
        dp[i][j] %= 998244353;
        prefix[i + 1][j] += prefix[i][j] + dp[i][j];
        prefix[i + 1][j] %= 998244353;
      }
    }
    for (int i = 0; i < n; i++) {
      answer += dp[i][k];
      answer %= 998244353;
    }
  }
  cout << answer << endl;
}
