Solves the recurrence ai = ai-1 c0 + ai-2 c1 + ... + ai-K cK-1. Inputs are: first line with K and N, next line with a0 to aK-1 in order, then line with c0 to cK-1 in order. Output is the answer. One file uses numpy, other uses standard python libraries.