#include <bits/stdc++.h>
using namespace std;
int a[55], dp[510005];
int main() {
  int n, d, sum = 0;
  scanf("%d%d", &n, &d);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), sum += a[i];
  dp[0] = true;
  for (int i = 1; i <= n; i++) {
    for (int j = sum; j >= a[i]; j--)
      if (dp[j - a[i]]) dp[j] = true;
  }
  int cur = 0, ans = 0;
  while (1) {
    cur += d;
    int idx = d;
    for (int i = 0; i <= d; i++)
      if (dp[cur - i]) {
        idx = i;
        break;
      }
    if (idx == d) {
      cur -= d;
      break;
    } else
      cur -= idx;
    ans++;
  }
  printf("%d %d\n", cur, ans);
  return 0;
}
