dinamic programming
segment tree
