Mike and Task Packages

All submissions for this problem are available.
Read problems statements in Mandarin Chinese and Russian.
Mike takes part in olympiads in informatics. You think he is a rookie? Wrong! He is an experienced and wellprepared competitor! He participated in many important contests and won some of them. Now his level is rather high.
In order to keep fit, Mike decided to improve his training sessions. He downloaded N task packages. There are A_{i} tasks in i'th package. They are really interesting and complicated, so Mike wants to solve them all!
Unfortunately, it is going to be an important contest in a few days, so Mike can solve at most X tasks before it. Let's assume, that Mike can solve any X problems before the contest.
Do you know what makes Mike happy? Right! Successful packages! A package of tasks is successful, if Mike solved all the tasks in it.
Do you also know what makes Mike sad? Right! Failed packages! A package of tasks is failed, if Mike solved less than a half of the tasks in it.
Please, help Mike to organize his training session!
Mike wants to minimize the number of failed packages. If there are several ways of doing this, he wants to maximize the number of successful packages. Remember also that he can't solve more than X tasks before the contest.
Input
The first line contain two integers N and X.
The second line contain N positive integers, i'th integer denotes A_{i}. The array A is 1indexed.
Output
The first line should contain two integers: the number of failed packages and the number of successful packages in the optimal way of solving.
Example
Input: 3 10 3 4 5 Output: 0 2
Explanation
In the test case N equals to 3, X equals to 10, A equals to {3, 4, 5}. It is optimal to solve all the problems in the first and the second packages and to solve 3 problems in the third package.
Scoring
0 ≤ X ≤ 10^{15} for each test case;
1 ≤ A_{i} ≤ 10^{9} for each test case.
Subtask 1 (10 points): 1 ≤ N ≤ 100, A_{1} + A_{2} + ... + A_{N} ≤ X;
Subtask 2 (21 point): 1 ≤ N ≤ 15;
Subtask 3 (29 points): 1 ≤ N ≤ 1000;
Subtask 4 (25 points): 1 ≤ N ≤ 100 000;
Subtask 5 (15 points): 1 ≤ N ≤ 1 000 000.
Author:  kostya_by 
Editorial  http://discuss.codechef.com/problems/MIKE2 
Tags  greedy, kostya_by, ltime07, simple 
Date Added:  28112013 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, PYP3, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 