单项选择题

已知数列的通项公式是an=2n-49,则前n项的和Sn达到最小值时,n为().

A.23
B.24
C.25
D.26