#include <bits/stdc++.h>
using namespace std;
bool dp[500050];
int trace[500050];
int n, d;
int a[55];
int main() {
  scanf("%ld%ld", &n, &d);
  for (int i = 1; i <= n; i++) scanf("%ld", &a[i]);
  memset(dp, false, sizeof(dp));
  dp[0] = true;
  for (int i = 1; i <= n; i++)
    for (int j = 500000; j >= 0; j--)
      if ((dp[j] == true) && (j + a[i] <= 500000)) dp[j + a[i]] = true;
  int pos;
  for (int i = 0; i <= 500000; i++) {
    if (dp[i] == true) pos = i;
    trace[i] = pos;
  }
  int now = 0, day = 0;
  while (now <= 500000) {
    if (trace[min(now + d, 500000)] == now) break;
    now = trace[min(now + d, 500000)];
    day++;
  }
  printf("%ld %ld", now, day);
  return 0;
}
