4. In the company, several employees have a total monthly salary of 10000 dollars. A kind manager proposes to double the salary for everyone earning up to 500 dollars, and increase the salary by 500 dollars for the rest, so the total salary will become 17000 dollars. A mean manager proposes to reduce the salary to 500 dollars for everyone earning more than 500 dollars, and leave the rest as is. What will the total salary be in this case?
Solution. Answer: 7000

Let's look at the difference between the total salary from the kind manager and the current one, and we will understand that this is the total salary from the evil manager:

up to 500 - from the doubled we subtract the current, we get the current

over 500 - from the increased by 500 we subtract the current, we get 500