In a campaign, two teams, A and B, collected some old books. 1/4 of the old books Team A collected was equal to 2/5 of the old books Team B collected. After Team B collected another 987 old books and Team A gave away 2073 old books, the two teams had the same number of old books left. How many old books had each team left in the end?

Let's start by setting up equations to represent the information given in the problem.

Let x be the number of old books collected by Team A initially.
Let y be the number of old books collected by Team B initially.

From the first sentence of the problem, we know that:

(1/4)x = (2/5)y

We can simplify this equation by multiplying both sides by 20:

5x = 16y

Now let's use this equation to solve for one of the variables in terms of the other. We'll solve for y:

y = (5/16)x

Next, let's consider the second part of the problem. After Team B collected another 987 books and Team A gave away 2073 books, the two teams had the same number of old books left. Let's use this information to set up another equation. Let's call the number of old books left after these changes are made "z".

We know that z is the same for both teams, so:

x - 2073 = y + 987 + z

We can substitute y = (5/16)x into this equation to get:

x - 2073 = (5/16)x + 987 + z

We can simplify this equation by subtracting (5/16)x from both sides:

(11/16)x - 2073 = 987 + z

Now we can solve for z:

z = (11/16)x - 3060

Now we have two equations that we can use to solve for x and y. We'll use the first equation we set up:

5x = 16y

And we'll substitute y = (5/16)x into it:

5x = 16(5/16)x

Simplifying this equation, we get:

5x = 5x

This equation doesn't tell us much, but that's okay. We can use it to solve for one of the variables in terms of the other. Let's solve for y:

y = (5/16)x

Now we can substitute y = (5/16)x and z = (11/16)x - 3060 into our equation from earlier:

x - 2073 = (5/16)x + 987 + (11/16)x - 3060

Let's simplify this equation:

x - 2073 = (16/16)x - 2073

We can simplify further by adding 2073 to both sides:

x = 2073

Now we can use this value of x to solve for y and z:

y = (5/16)x = (5/16)(2073) = 645
z = (11/16)x - 3060 = (11/16)(2073) - 3060 = 264

Therefore, Team A initially collected 2073 old books, Team B initially collected 645 old books, and in the end, both teams had 264 old books left.

Let's assume the number of old books Team A collected initially is "x", and the number of old books Team B collected initially is "y".

According to the given information:
- 1/4 of the old books Team A collected = 2/5 of the old books Team B collected

This can be expressed as:
(1/4) * x = (2/5) * y

To simplify the equation, let's multiply both sides by 20:
5x = 8y

Now, let's solve this equation to find the relation between x and y.

Divide both sides by 5:
x = (8y) / 5

Now, let's move on to the next part of the problem.

After Team B collected another 987 old books, the new total for Team B is y + 987.

Team A gave away 2073 old books, so the new total for Team A is x - 2073.

It is given that after these changes, the two teams have the same number of old books left.

So, we can write the equation:
(x - 2073) = (y + 987)

Now, let's solve this equation to find the values of x and y.

Rearranging the equation:
x - y = 3060

Substituting the value of x from our initial equation:
((8y) / 5) - y = 3060

Multiply both sides by 5 to remove the fraction:
8y - 5y = 15300

Simplifying the equation:
3y = 15300

Divide both sides by 3:
y = 5100

Substituting this value into the initial equation:
x = (8 * 5100) / 5
x = 8160

Therefore, initially Team A collected 8160 old books, and Team B collected 5100 old books.

Now, let's calculate the final number of old books left for each team.

For Team B:
After collecting 987 more old books, they have a total of 5100 + 987 = 6087 old books.

For Team A:
After giving away 2073 old books, they have a total of 8160 - 2073 = 6087 old books.

Hence, both teams have the same number of old books left, which is 6087 old books.