7.1. In a hotel, rooms are arranged in a row in order from 1 to 10000. Masha and Alina checked into the hotel in two different rooms. The sum of the room numbers they are staying in is 2022, and the sum of the room numbers of all the rooms between them is 3033. In which room is Masha staying, if her room has a lower number than Alina's room?
Answer: 1009

Solution. If there is exactly one room between Masha's and Alina's rooms, then it is room number 3033, but then Masha's and Alina's rooms are 3032 and 3034, and their sum is not 2022.

Consider room B, whose number is 1 more than Masha's room. Also consider room V, whose number is 1 less than Alina's room. Note that the sum of the numbers of rooms B and V is also 2022, so there are at least three rooms between Alina and Masha.

If there are at least four rooms, then take rooms Γ and D adjacent to rooms B and V: M, B, Γ, .., D, V, A. The sum of the numbers of Γ and D is also 2022, but then the sum of the numbers between them is at least 4044, which is too many.

Therefore, there are exactly three rooms between Alina and Masha, the sum of the two outermost rooms is 2022, and the middle number is 1011. Then our numbers are: 1009, 1010, 1011, 1012, 1013. Masha's room number is 1009.