#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n, k;
int dp[1005][1005], a[1005];
int solve(int x) {
  dp[0][0] = 1;
  int pre = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = dp[i - 1][0];
    while (a[i] - a[pre + 1] >= x) pre++;
    for (int j = 1; j <= k; j++)
      dp[i][j] = (dp[i - 1][j] + dp[pre][j - 1]) % mod;
  }
  return dp[n][k] % mod;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  int up = a[n] / (k - 1);
  long long ans = 0;
  for (int i = 1; i <= up; i++) ans += solve(i);
  ans %= mod;
  printf("%lld\n", ans);
  return 0;
}
