what i did was : i created a multiset and push all the elements in the set initially. Now, i check that whether we can make k elements out starting from the first element (as it is the smallest one and if it is not possible then we can guarantee that starting from any other element is also not possible) .I do this as far as possible and increases the count every time .
I am getting WA in all the test cases …if possible then please tell me where my logic is lacking !
thanks for looking into my code…i know debugging other’s code is very boring but i am trying this for last 3 days but yet didnt able to get it accepted …(: so, i have no option…