#include <bits/stdc++.h>
using namespace std;
int n, a[55];
bool s[5500000];
int main() {
  int n, d;
  cin >> n >> d;
  int sum = 0;
  for (int i = 0; i < n; i++) cin >> a[i], sum += a[i];
  memset(s, false, sizeof(s));
  s[0] = true;
  for (int i = 0; i < n; i++)
    for (int j = sum; j >= a[i]; j--) s[j] |= s[j - a[i]];
  vector<int> x;
  for (int i = 1; i <= sum; i++)
    if (s[i]) x.push_back(i);
  int cur = 0, day = 0, nn = x.size();
  while (cur < sum) {
    int lim = min(cur + d, sum);
    int l = 0, r = nn - 1, w = -1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (x[mid] <= lim)
        w = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    if (w == -1) {
      cout << 0 << " " << 0 << endl;
      return 0;
    }
    if (x[w] > cur)
      cur = x[w];
    else {
      cout << cur << " " << day << endl;
      return 0;
    }
    day++;
  }
  cout << cur << " " << day << endl;
  return 0;
}
