#include <bits/stdc++.h>
using namespace std;
int n, d;
int a[55];
int f[55][550010];
int dp(int l, int last) {
  for (int i = 1; i <= n; i++)
    for (int j = last; j <= l; j++)
      f[i][j] = max((j >= a[i] ? f[i - 1][j - a[i]] + a[i] : 0), f[i - 1][j]);
  return f[n][l];
}
int main() {
  scanf("%d%d", &n, &d);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int t = dp(d, 0), cnt = 1;
  if (t == 0) {
    printf("0 0\n");
    return 0;
  }
  while (1) {
    int q = dp(d + t, t);
    if (q <= t)
      break;
    else
      t = q, cnt++;
  }
  printf("%d %d\n", t, cnt);
  return 0;
}
