#include <bits/stdc++.h>
using namespace std;
int n, d;
int a[60];
int dp[60][500000 + 10];
void solve() {
  int i, j, ans, days, temp;
  bool flag;
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (i = 0; i < n; i++)
    for (j = 0; j <= 500000; j++)
      if (dp[i][j]) {
        dp[i + 1][j] = 1;
        dp[i + 1][j + a[i]] = 1;
      }
  ans = 0;
  days = 0;
  while (true) {
    flag = false;
    for (i = ans + 1; i <= min(ans + d, 500000); i++)
      if (dp[n][i]) {
        temp = i;
        flag = true;
      }
    if (!flag) break;
    ans = temp;
    days++;
  }
  printf("%d %d\n", ans, days);
}
void input() {
  int i;
  scanf("%d %d", &n, &d);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  solve();
}
int main() {
  input();
  fclose(stdin);
  fclose(stdout);
  return 0;
}
