Solved task for sum of range