#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n, d, a[55];
bool dp[10005 * 55];
void solve() {
  memset(dp, 0, sizeof(dp));
  dp[0] = true;
  for (int i = 1; i <= n; i++) {
    for (int s = (i - 1) * 10005; s >= 0; s--) {
      dp[a[i] + s] |= dp[s];
    }
  }
  int sum = 0;
  int steps = 0;
  int lim = 10005 * 55 - 1;
  while (true) {
    int newSum;
    for (newSum = min(lim, sum + d); newSum >= sum; newSum--) {
      if (dp[newSum]) {
        break;
      }
    }
    if (newSum == sum) {
      break;
    } else {
      steps++;
      sum = newSum;
    }
  }
  cout << sum << ' ' << steps << endl;
}
int main() {
  while (cin >> n >> d) {
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    solve();
  }
}
