Add solutions for SRM 587 Div 2