#include <bits/stdc++.h>
using namespace std;
int N, D;
int A[55];
bool dp[500005];
int kk[500005];
int main() {
  scanf("%d %d", &N, &D);
  for (int c = 1; c <= N; c++) scanf("%d", &A[c]);
  dp[0] = true;
  for (int c = 1; c <= N; c++)
    for (int d = 500000; d >= 0; d--)
      if (dp[d]) dp[d + A[c]] = true;
  int pt = 0;
  for (int c = 1; c <= 500000; c++) {
    if (dp[c]) pt = c;
    kk[c] = pt;
  }
  int now = 0, day = 0;
  while (now < 500000) {
    if (kk[min(now + D, 500000)] == kk[now]) break;
    now = kk[min(now + D, 500000)];
    day++;
  }
  printf("%d %d\n", now, day);
}
