1. I find all sets of points that lie on the same line and there are no two sets that one of them is the subset of another.
2. I use structure Cache to store solutions for subtasks.
3. Let Si is sets of points that lie on the same line, founded in 1. I try to find solution:std::map< int, /* quontity of trees to be cut off * /
std::map<
PointSet,/* set for that we know solution * /
int /* number of shoots * /
>
>
Cache;
3.1. if for some k = 0,1,...,(m - 1) i've found solution for F(SetOfTrees,k) and this solution can be used for k = m, then I return this solution.
3.2. else to find solution I use formula F(SetOfTrees,m) = 1 + min(F(SetOfTrees - Si,m - Intersection(SetOfTrees,Si)))
Is my algorithm correct?