#include <bits/stdc++.h>
using namespace std;
const int MAXN = 55;
const int MAXC = 10005;
int c[MAXN];
int n, d;
const int MAXW = MAXC * MAXN;
bool p[MAXW];
void fill_p(void) {
  memset(p, false, MAXW * sizeof(bool));
  p[0] = true;
  for (int j = 0; j < n; j++)
    for (int i = MAXW - 1; i >= c[j]; i--) p[i] |= p[i - c[j]];
}
int main() {
  cin >> n >> d;
  for (int i = 0; i < n; i++) cin >> c[i];
  fill_p();
  int price = 0;
  int days = 0;
  int r = 0 + 0;
  int best = -1;
  while (true) {
    best = -1;
    for (int i = max(price + 1, r); i <= price + d && i < MAXW; i++) {
      if (p[i]) best = i;
      r = i;
    }
    if (best == -1) break;
    price = best;
    days++;
  }
  cout << price << ' ' << days;
  return 0;
}
