Read the passage given below and solve the questions based on it.
Two cars A and B start simultaneously from two different cities P and Q and head for the cities Q and P respectively. As soon as car A reaches the city Q, it turns and starts for city P and as soon as it reaches P again, it leaves for city Q and so on. Similarly, car B, travels from Q to P, from P to Q and so on. The speeds of the car A and B are in the ratio of 3:4.
If car B travelled 1040 m when the two cars meet for the seventh time, what is the distance between the two cities P and Q?