#include <bits/stdc++.h>
using namespace std;
const int N = 51;
const int M = 10000;
const int G = M * N + 15;
bool memo[G];
void solve2() {
  int n, d;
  scanf("%d %d ", &n, &d);
  memo[0] = true;
  int maxSum = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    for (int j = maxSum; j >= 0; --j) {
      if (memo[j]) {
        memo[j + x] = true;
      }
    }
    maxSum += x;
  }
  int cur = 0, cc = 0;
  while (true) {
    int maxi = min(cur + d, G - 1), j;
    for (j = maxi; j >= cur; --j) {
      if (memo[j]) {
        break;
      }
    }
    if (cur == j) break;
    ++cc;
    cur = j;
  }
  printf("%d %d\n", cur, cc);
}
void solve() { solve2(); }
inline bool exists_test0(const std::string& name);
inline bool exists_test1(const std::string& name);
int main() {
  solve();
  return 0;
}
inline bool exists_test0(const std::string& name) {
  ifstream f(name.c_str());
  return f.good();
}
inline bool exists_test1(const std::string& name) {
  if (FILE* file = fopen(name.c_str(), "r")) {
    fclose(file);
    return true;
  } else {
    return false;
  }
}
