#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, dp[555555], ans, sum, x;
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> x;
    for (j = 500000; j >= x; j--) {
      dp[j] |= dp[j - x] || j - x == 0;
    }
  }
  bool d = 1;
  while (d && ++ans) {
    d = 0;
    for (i = m + sum; i > sum; i--) {
      if (dp[i]) {
        d = 1;
        sum = i;
        break;
      }
    }
  }
  cout << sum << ' ' << ans - 1;
  return 0;
}
