4. At a rectangular table, eight chairs are placed, four on one side and four opposite them on the other side. In how many ways can eight friends be seated at this table so that Ana and Bane sit opposite each other, and Vesna and Goran sit next to each other? (It is known that all friends have distinct names.)


4. We can choose the country for Vesna and Goran in 2 ways, their position as a pair in 3 ways, and their mutual arrangement in 2 ways, i.e., we can arrange them in 12 ways. Now let's arrange Ana and Banet. On the side where Vesna and Goran are, there are two free seats, so we can choose the position of Ana and Banet in 2 ways, and then who sits on which side in 2 ways. Thus, we can arrange them in 4 ways. For the remaining 4 guests, there are 4 free seats, so we can arrange them in 4! ways. Therefore, the total number of arrangements is $12 \cdot 4 \cdot 4!=1152$.