#include <bits/stdc++.h>
using namespace std;
int dp[500010];
int c[100];
int main() {
  int n, d;
  scanf("%d%d", &n, &d);
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 500000 - c[i]; j >= 0; j--) {
      if (dp[j]) dp[j + c[i]] = 1;
    }
  }
  int mas = 0;
  int day = 0;
  while (1) {
    int x = mas + d;
    if (x >= 500000) x = 500000;
    while (x > mas && !dp[x]) x--;
    if (x == mas) {
      printf("%d %d\n", mas, day);
      break;
    }
    mas = x;
    day++;
  }
  return 0;
}
