#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return a % b == 0 ? b : gcd(b, a % b); }
const int MAXN = 700010;
int N, D;
int dp[MAXN];
int main() {
  while (scanf("%d%d", &N, &D) != EOF) {
    memset(dp, 0, sizeof(dp));
    dp[0] = 1;
    int sum = 0;
    for (int i = 1; i <= N; i++) {
      int x;
      scanf("%d", &x);
      sum += x;
      for (int j = sum; j >= x; j--)
        if (dp[j - x]) dp[j] = 1;
    }
    int day = 0, ret = 0;
    while (true) {
      ret += D;
      int pos = D;
      for (int i = 0; i < D; i++)
        if (dp[ret - i]) {
          pos = i;
          break;
        }
      if (pos == D) {
        ret -= D;
        break;
      }
      day++;
      ret -= pos;
    }
    printf("%d %d\n", ret, day);
  }
  return 0;
}
