#include <bits/stdc++.h>
using ll = long long;
ll arr[105], app[105], ans1, ans2;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%lld", arr + i);
  for (int sum = 2; sum <= m + m; sum++) {
    app[0] = 0;
    for (int i = 0; i < n; i++) app[i + 1] = arr[i] % sum;
    app[n + 1] = sum - 1;
    std::sort(app, app + n + 2);
    for (int i = n + 1; i; i--) {
      int lp = app[i - 1] + 1, rp = std::min<int>(app[i], m);
      if (n + 1 - i & 1)
        lp = std::max<int>(lp, app[n - 1] / 2 + 1);
      else
        lp = std::max<int>(lp, app[n] / 2 + 1);
      int x = std::max(lp, sum - rp), y = std::min(rp, sum - lp);
      if (x <= y) (n + 1 - i & 1 ? ans1 : ans2) += y - x + 1;
    }
  }
  ll ans = ((ll)m * m - ans1 - ans2) / 2;
  printf("%lld %lld %lld %lld\n", ans, ans, ans1, ans2);
  return 0;
}
