HR's new rule: nobody may earn less than the average salary of their department minus 40,000. Raise anyone below that floor up to exactly the floor (rounded to the nearest rupee). Ignore employees without a department.
Run your code to see the output here.