#include <bits/stdc++.h>
using namespace std;
long long n, d, s, mx, xb, a[51];
bool dp[1000001];
inline long long read() {
  long long sum = 0, x = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') x = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    sum = (sum << 1) + (sum << 3) + (ch ^ '0');
    ch = getchar();
  }
  return sum * x;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
signed main() {
  n = read();
  d = read();
  for (register long long i = 1; i <= n; ++i) {
    a[i] = read();
    s += a[i];
  }
  dp[0] = 1;
  for (register long long i = 1; i <= n; ++i)
    for (register long long j = s; j >= a[i]; --j) dp[j] |= dp[j - a[i]];
  while (1) {
    mx += d;
    long long i;
    for (i = 0; i < d; ++i)
      if (dp[mx - i]) break;
    mx -= i;
    if (i != d)
      ++xb;
    else
      break;
  }
  write(mx);
  putchar(' ');
  write(xb);
  putchar('\n');
  return 0;
}
