#include <bits/stdc++.h>
using namespace std;
int const maxn = 60, maxl = 10010;
int f[maxn * maxl];
int n, d, c, sum;
int main() {
  cin >> n >> d;
  f[0] = 1;
  for (int i = 0; i < n; i++) {
    cin >> c;
    for (int j = sum; j >= 0; j--)
      if (f[j]) f[j + c] = 1;
    sum += c;
  }
  int last = 0, t = 0;
  while (true) {
    int cur = last;
    for (int i = d; i > 0; i--) {
      if (f[last + i]) {
        cur = last + i;
        break;
      }
    }
    if (cur == last) {
      cout << last << ' ' << t << endl;
      break;
    }
    last = cur;
    t++;
  }
}
