Classic range DP problem, which might be challenging to come up with at first. Define DP as following. $dpi= \\text{number of triples that has sum of