#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int main() {
  int n, d, sum = 0;
  cin >> n >> d;
  vector<int> c(n);
  for (int i = 0; i < n; ++i) {
    cin >> c[i];
    sum += c[i];
  }
  vector<bool> can(sum + 1);
  can[0] = true;
  for (int i = 1; i <= sum; ++i) can[i] = false;
  for (int i = 0; i < n; ++i) {
    for (int j = sum - c[i]; j >= 0; --j)
      if (can[j]) can[j + c[i]] = true;
  }
  int days = 0, ans = 0;
  bool uze;
  while (1) {
    uze = false;
    for (int i = min(sum, ans + d); i > ans; --i) {
      if (can[i]) {
        ++days;
        ans = i;
        uze = true;
        break;
      }
    }
    if (!uze) break;
  }
  printf("%d %d\n", ans, days);
}
