spoj SAMER08F dynamic programming