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

Why are there $\displaystyle 2n $ interlopary conditions and $\displaystyle 2n-2 $ continuity conditions?