#include <bits/stdc++.h>
using namespace std;
const int maxn = 60, maxv = 500010;
bool f[maxv];
int g[maxv];
int v[maxn], totv;
int n, d;
void init() {
  cin >> n >> d;
  for (int i = 1; i <= n; ++i) cin >> v[i];
}
void dp() {
  totv = 0;
  for (int i = 1; i <= n; ++i) totv += v[i];
  memset(f, false, sizeof(f));
  f[0] = true;
  for (int i = 1; i <= n; ++i) {
    for (int j = totv; j >= v[i]; --j) f[j] = f[j] || f[j - v[i]];
  }
  g[0] = 0;
  for (int i = 1; i <= totv; ++i)
    if (f[i])
      g[i] = i;
    else
      g[i] = g[i - 1];
}
void solve() {
  int ans1 = 0, ans2 = 0;
  for (;;) {
    if (ans1 + d >= totv) {
      ans1 = g[totv], ++ans2;
      break;
    }
    if (g[ans1 + d] == ans1) break;
    ans1 = g[ans1 + d], ++ans2;
  }
  cout << ans1 << ' ' << ans2 << endl;
}
int main() {
  init();
  dp();
  solve();
  return 0;
}
