#include <bits/stdc++.h>
using namespace std;
const int MAXN = 50;
int main() {
  int N, D;
  cin >> N >> D;
  int a[MAXN];
  for (int i = 0; i < N; i++) cin >> a[i];
  const int MAXSUM = accumulate(a, a + N, 0);
  vector<bool> dp(MAXSUM + 1, false);
  dp[0] = true;
  for (int i = 0; i < N; i++)
    for (int j = MAXSUM; j - a[i] >= 0; j--) dp[j] = dp[j] || dp[j - a[i]];
  int maxsum = 0, day = 0;
  while (1) {
    int t = -1;
    for (int i = maxsum + 1; i <= min(MAXSUM, maxsum + D); i++)
      if (dp[i] == true) t = i;
    if (t == -1) break;
    maxsum = t;
    day++;
  }
  cout << maxsum << " " << day << endl;
  return 0;
}
