recursive+dp