Let $\displaystyle S(d,c) = \sum_{j=1}^{c} (-1)^{j+1+\left\lfloor\frac{dj}{c}\right\rfloor} $.

Show $\displaystyle S(d,c)+S(c,d) = 3 $ when $\displaystyle d,c $ have opposite parity and $\displaystyle (c,d)=1 $.