#include <bits/stdc++.h>
using namespace std;
int n, d;
int v[10100];
int memo[60 * 10100];
int main() {
  scanf("%d %d", &n, &d);
  int MAX = 0;
  for (int i = 0; i < (n); i++) {
    scanf("%d", &v[i]);
    MAX += v[i];
  }
  int res = 0;
  int soma = 0;
  MAX += d;
  memset(memo, 0, sizeof(memo));
  memo[0] = 1;
  for (int i = 0; i < (n); i++) {
    for (int w = MAX; w >= 0; w--) {
      if (w - v[i] < 0) break;
      memo[w] = memo[w] | memo[w - v[i]];
    }
  }
  while (1) {
    bool changed = false;
    for (int i = d; i > 0; i--) {
      if (memo[soma + i]) {
        res++;
        soma = soma + i;
        changed = true;
        break;
      }
    }
    if (!changed) break;
  }
  printf("%d %d\n", soma, res);
  return 0;
}
