Given that,
Let's assume there are x pens in box B.
Now, there will be 5x pens in box A.(Because there are 5 times as many pens in box A than in box B).
They had the same number of pens when Tom moves 76 pens from box A to box B.
So, after moving 76 pens from box A to box B:
Box A contains 5x-76 pens.
Box B contains x+76.
Now, Box A and Box B have the same number of pens.
We have to equate the number of pens in both boxes:
5x-76=x+76
4x=152
x=38
5x=190
Box A has 190 pens.