Getting wrong answer

Hello…
I am solving this question from codeforces…
https://codeforces.com/contest/1369/problem/C

The logic i have followed is first i sorted the array in decreasing manner and then sorted the array in which number of wi’s present in ascending order.
Now i filled the vector v as per the size of each vector present in v and comparing them with wi;s.
Please see this…
Don’t know why it is showing wrong answer…
https://codeforces.com/contest/1369/submission/103504784
Thanks