已知等差数列{an},a5=14,a2+a9=31,求:a1及公差d的值;数列前12项的和sn