HELP spoj ACMAKER - ACM (ACronymMaker)

Link for problem is https://www.spoj.com/problems/ACMAKER/
I googled this problem but didn’t able to grab the approach . Pls help

guys pls try this problem ; this is one of good problem on dp

Hi @gyanendra371, did you solve this one?