Solve SRM 149, Div 2, Problem FormatAmt