add dp for minsubsum