#include <bits/stdc++.h>
using namespace std;
const int N = 50;
const int M = 510000;
int c[N + 10];
bool sum[M + 100];
int main() {
  int n, d, i, j, all = 0;
  scanf("%d%d", &n, &d);
  for (i = 1; i <= n; i++) {
    scanf("%d", &c[i]);
    all += c[i];
  }
  sum[0] = true;
  for (i = 1; i <= n; i++)
    for (j = all; j >= 1; j--)
      if (j - c[i] >= 0 && sum[j - c[i]]) sum[j] = true;
  int now = 0, day = 0;
  for (; now < all + d; day++) {
    bool found = false;
    for (i = now + d; i >= now + 1; i--) {
      if (sum[i]) {
        now = i;
        found = true;
        break;
      }
    }
    if (!found) break;
  }
  printf("%d %d\n", now, day);
  return 0;
}
