#include <bits/stdc++.h>
bool dp[555555];
int n, x, i, j;
int main() {
  while (~scanf("%d%d", &n, &x)) {
    memset(dp, 0, sizeof(dp));
    dp[0] = 1;
    int t;
    for (int i = 0; i < n; ++i) {
      scanf("%d", &t);
      for (int mx = 555555 - 1; mx >= t; --mx) {
        dp[mx] = dp[mx] || dp[mx - t];
      }
    }
    int turn = 0, val = 0;
    while (true) {
      int go = val + x;
      while (!dp[go] && go > val) --go;
      if (go == val) break;
      val = go;
      ++turn;
    }
    printf("%d %d\n", val, turn);
  }
  return 0;
}
