#include <bits/stdc++.h>
using namespace std;
const int max_sum = 500005, max_n = 55;
int n, d;
int a[max_n];
bool subset[max_sum][max_n];
int main() {
  int sum = 0;
  scanf("%d%d", &n, &d);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  for (int i = 0; i <= n; i++) subset[0][i] = true;
  for (int i = 1; i <= sum; i++) subset[i][0] = false;
  for (int i = 1; i <= sum; i++) {
    for (int j = 1; j <= n; j++) {
      subset[i][j] = subset[i][j - 1];
      if (i >= a[j - 1])
        subset[i][j] = subset[i][j] || subset[i - a[j - 1]][j - 1];
    }
  }
  int i = 0, j = 1, k = 0;
  int nm = 0;
  while (1) {
    while (j <= i + d and j <= sum) {
      if (subset[j][n]) k = j;
      j++;
    }
    if (k == i) break;
    i = k;
    nm++;
  }
  printf("%d %d\n", i, nm);
  return 0;
}
