#include <bits/stdc++.h>
using namespace std;
const int N = 555555;
bool dp[N];
int main() {
  int n, d;
  while (cin >> n >> d) {
    memset(dp, 0, sizeof(dp));
    int c;
    dp[0] = 1;
    for (int i = 0; i < n; i++) {
      cin >> c;
      for (int j = N - 1; j >= c; j--) dp[j] |= dp[j - c];
    }
    int mx = 0, cnt = 0;
    while (1) {
      int nx = mx + d;
      while (!dp[nx]) nx--;
      if (nx == mx) break;
      mx = nx;
      cnt++;
    }
    cout << mx << ' ' << cnt << endl;
  }
  return 0;
}
