#include <bits/stdc++.h>
using namespace std;
bool dp[555556];
int main() {
  long long t, i, j, k, ans, n, d, sum;
  t = 1;
  while (t--) {
    cin >> n >> d;
    vector<long long> v(n);
    sum = 0;
    dp[0] = 1;
    for (long long p = 0; p < n; p++) {
      cin >> v[p];
      for (long long q = 555555; q >= v[p]; q--) dp[q] |= dp[q - v[p]];
    }
    long long mx = 0, nx, days = 0;
    while (1) {
      nx = mx + d;
      while (!dp[nx]) nx--;
      if (nx == mx) break;
      days++;
      mx = nx;
    }
    cout << mx << " " << days;
  }
  return 0;
}
