Maximum sum through a triangle structure