Optimal Success Bounds for Single Query Quantum Algorithms Computing the General SUM Problem