#include #include #include #include int main(int argc, char *argv[]){ int n; std::cout<<"Enter the number of candles."<>n; std::vector c; std::cout<<"Enter the lengths of the candles."<>temp; c.push_back(temp); } int no_of_days=0; while(!c.empty()){ if(c.size()>no_of_days){ no_of_days++; std::sort(c.begin(), c.end(), std::greater()); std::transform(c.begin(), c.begin()+no_of_days, c.begin(), std::bind2nd(std::minus(), 1) ); c.erase(std::remove(c.begin(), c.end(), 0), c.end()); }else{ break; } } std::cout<<"No. of days the event can go on = "<