#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, sum = 0;
  cin >> n >> d;
  vector<int> dp(1000000, 0);
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    sum += a;
    for (int j = sum; j >= a; j--) dp[j] |= dp[j - a];
  }
  int i;
  int days = 0, cost = 0;
  while (1) {
    for (i = cost + d; i >= cost; i--)
      if (dp[i]) break;
    if (i == cost) break;
    cost = i;
    days++;
  }
  cout << cost << " " << days << endl;
  return 0;
}
