#include <bits/stdc++.h>
using namespace std;
int d[600050];
int a[100];
int main() {
  int x, n;
  scanf("%d%d", &n, &x);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  sort(a, a + n);
  int sum = 0;
  d[0] = 1;
  for (int i = 0; i < n; ++i) {
    if (sum + x < a[i]) break;
    for (int j = sum; j >= 0; --j) {
      if (d[j]) d[j + a[i]] = 1;
    }
    sum += a[i];
  }
  int cnt = 0;
  int now = 0;
  while (true) {
    int pos = -1;
    for (int i = now + x; i > now; --i) {
      if (d[i]) {
        pos = i;
        break;
      }
    }
    if (pos <= now) break;
    cnt++;
    now = pos;
  }
  printf("%d %d\n", sum, cnt);
  return 0;
}
