basic problems on dp
2-dimensional problem