Wendy has 80-x pieces. Between them they have 80+80-x=160-x pieces. When they have equal numbers of candies they will have 80-x/2 pieces each. Wendy will gain 80-x/2-(80-x)=-x/2+x=x/2 candies. Judi will lose 80-(80-x/2)=x/2. So Judi must give Wendy x/2 pieces of candy.