#include <bits/stdc++.h>
using namespace std;
bool dp[5 * 100000 + 100];
int c[55];
int main() {
  int n, d;
  int sum = 0;
  cin >> n >> d;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    sum += c[i];
  }
  dp[0] = 1;
  for (int i = 0; i < n; ++i)
    for (int j = sum; j >= c[i]; --j) dp[j] |= dp[j - c[i]];
  int val = 0, cnt = 0;
  while (1) {
    int i, tmp = val;
    for (i = val + d; i > val; --i)
      if (i <= sum && dp[i]) {
        val = i;
        ++cnt;
        break;
      }
    if (i == tmp) break;
  }
  cout << val << " " << cnt << endl;
}
