#include <bits/stdc++.h>
using namespace std;
int n, d, c[55];
int can[55 * 10000], sum = 0;
int main() {
  cin >> n >> d;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    sum += c[i];
  }
  can[0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = sum - c[i]; j >= 0; j--)
      if (can[j]) can[j + c[i]] = 1;
  int mx = 0, nmx = 0, ans = 0;
  while (1) {
    mx = nmx;
    for (int i = mx + 1; i <= min(sum, mx + d); i++)
      if (can[i]) nmx = i;
    if (mx == nmx) break;
    mx = nmx;
    ans++;
  }
  cout << mx << " " << ans << endl;
}
