Suppose we are given some values  y_0, y_1, \ldots, y_n of a function  y(x) at a set of equally spaced points  t_i = t_0+ih \ (0 \leq i \leq n) . We want to find a smooth function  S(x) that fits the data subject to following conditions: (i) within each interval  S(x) is a cubic which is different, (ii) derivatives of all order are continuous on  [t_0, t_n] and (iii)  S(t_i) = y_i for  i = 1, \dots, n .

Why are there  2n interlopary conditions and  2n-2 continuity conditions?