#include <bits/stdc++.h>
using namespace std;
int n, d;
int c[1000000];
int puede[1000000];
int main() {
  cin >> n >> d;
  int suma = 0;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    suma += c[i];
  }
  puede[0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = suma; j >= c[i]; j--)
      if (puede[j - c[i]]) puede[j] = 1;
  int pasos = 0;
  int coste = 0;
  {
    int j = 0;
    for (;;) {
      int nextcoste = coste;
      while ((j + 1) <= suma and j + 1 <= coste + d) {
        j++;
        if (puede[j]) nextcoste = j;
      }
      if (nextcoste == coste) break;
      pasos++;
      coste = nextcoste;
    }
  }
  cout << coste << " " << pasos << endl;
}
