I have a problem with divided differences.

Let f be a function such as $\displaystyle f(x)=cos(Pi*x)$. Find a polynom of degree minor or equal to 3 that satisfy :

$\displaystyle p(-1)=f(-1), p(0)=f(0), p(1)=f(1), p'(1)=f'(1).$

I think I have to make a table of divided difference. My problem is how do I deal the table when I have a condition on a derivate, such as p'(1)=f'(1). And how can I deal with double derivate conditions?