def P(U,V): return sum(x*y for x,y in zip(U,V))