compute c1 and c2