#include <bits/stdc++.h>
using namespace std;
int n, d;
bool dp[500010];
int main() {
  scanf("%d%d", &n, &d);
  memset(dp, false, sizeof(dp));
  dp[0] = true;
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    for (int j = 500010 - 1; j >= x; --j) dp[j] |= dp[j - x];
  }
  int ans = 0, day = 0;
  while (true) {
    bool flag = false;
    for (int i = ans + d; i >= ans + 1; --i)
      if (i < 500010 && dp[i]) {
        ans = i;
        flag = true;
        break;
      }
    if (flag)
      day++;
    else
      break;
  }
  printf("%d %d\n", ans, day);
  return 0;
}
