#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
long long dp[1005][1005], p[1005][1005], a[1005], l[1005];
int n, k;
long long ans;
long long solve(long long x) {
  for (int i = 0; i <= k; i++)
    for (int j = 0; j <= n; j++) dp[i][j] = 0;
  dp[0][0] = 1;
  l[0] = 0;
  for (int i = 1; i <= n; i++) {
    l[i] = l[i - 1];
    while (a[i] - a[l[i] + 1] >= x) l[i]++;
  }
  p[0][0] = 1;
  for (int i = 1; i <= n; i++) p[0][i] = p[0][i - 1] + dp[0][i];
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= n; j++) dp[i][j] = p[i - 1][l[j]];
    p[i][0] = dp[i][0];
    for (int j = 1; j <= n; j++) p[i][j] = (p[i][j - 1] + dp[i][j]) % mod;
  }
  long long ret = 0;
  for (int i = 1; i <= n; i++) ret = (ret + dp[k][i]) % mod;
  return ret;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (long long x = 1; x * (k - 1) <= a[n]; x++) ans = (ans + solve(x)) % mod;
  cout << ans << endl;
}
