A. 周末舞会

    Type: Default 1000ms 256MiB

周末舞会

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

假设在周末舞会上,男士们和女士们进入舞厅时,各自排成一队。跳舞开始时,依次从男队和女队的队头上各出一人配成舞伴。

规定每个舞曲能有一对跳舞者。若两队初始人数不相同,则较长的那一队中未配对者等待下一轮舞曲。

现要求写一个程序,模拟上述舞伴配对问题。

Input Format

第一行两队的人数; 第二行舞曲的数目。

Output Format

配对情况。

4 6
7

1 1
2 2
3 3
4 4
1 5
2 6
3 1

队列

Not Claimed
Status
Done
Problem
5
Open Since
2026-1-8 0:00
Deadline
2026-1-15 23:59
Extension
24 hour(s)