#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const int N = 10010;
int n, d;
bool f[N * 55];
int c[55];
int main() {
  while (~scanf("%d%d", &n, &d)) {
    int sum = 0;
    for (int i = 0; i < n; ++i) {
      scanf("%d", &c[i]);
      sum += c[i];
    }
    memset(f, 0, sizeof(f));
    f[0] = 1;
    for (int i = 0; i < n; ++i)
      for (int j = sum; j >= c[i]; --j) f[j] |= f[j - c[i]];
    int own = 0, cnt = 0;
    while (true) {
      bool ok = true;
      int tmp = own + d;
      for (; tmp > own; --tmp)
        if (tmp <= sum && f[tmp]) {
          ok = false;
          ++cnt;
          break;
        }
      if (ok || tmp == own) break;
      own = tmp;
    }
    printf("%d %d\n", own, cnt);
  }
  return 0;
}
