how to calculate sum multiply modulus of two global variables and two local variables