#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int dp[1234][1234], last[1234], sum[1234], n, k;
int arr[1234];
int solve(int val) {
  for (int i = 0; i <= k; i++)
    for (int j = 0; j <= n; j++) dp[i][j] = 0;
  dp[0][0] = 1;
  last[0] = 0;
  for (int i = 1; i <= n; i++) {
    last[i] = last[i - 1];
    while (arr[i] - arr[last[i] + 1] >= val) last[i]++;
  }
  for (int i = 0; i < k; i++) {
    sum[0] = dp[i][0];
    for (int j = 1; j <= n; j++) sum[j] = (sum[j - 1] + dp[i][j]) % mod;
    for (int j = 1; j <= n; j++) dp[i + 1][j] = sum[last[j]];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) ans += dp[k][i], ans %= mod;
  return ans;
}
int main() {
  ios::sync_with_stdio();
  cin.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  sort(arr + 1, arr + n + 1);
  int mx = arr[n], ans = 0;
  for (int i = 1; (k - 1) * i <= arr[n]; i++) ans = (ans + solve(i)) % mod;
  cout << ans << endl;
}
