设Sn是等差数列{an}的前n项和,若a1=-2.S4=10.则公差d=?