等差数列{an}前n项和为Sn,且Sn=3n^2+n 求公差d