#P2902. [USACO08MAR] Pearl Pairing G
[USACO08MAR] Pearl Pairing G
题目描述
At Bessie's recent birthday party, she received pearls, each painted one of C different colors ().
Upon observing that the number of pearls is always even, her creative juices flowed and she decided to pair the pearls so that each pair of pearls has two different colors.
Knowing that such a set of pairings is always possible for the supplied testcases, help Bessie perform such a pairing. If there are multiple ways of creating a pairing, any solution suffices.
在 Bessie 最近的生日聚会上,她收到 颗珍珠。一共有 种颜色的珍珠(),第 种颜色的珍珠有 颗。
观察到珍珠的数量 总是偶数,她的创意来了,决定配对珍珠,使每对珍珠有两种不同的颜色。数据保证存在答案。请帮助 Bessie 执行这样的配对,如果有多种配对的方法,输出任意一种即可。
输入格式
Line : Two space-separated integers: and .
Lines : Line tells the count of pearls with color : .
第 行:两个空格分隔的整数: 和 。
第 行:第 为颜色 的珍珠数 。
输出格式
Lines : Line contains two integers and indicating that Bessie can pair two pearls with respective colors and .
第 行:第 行包含两个整数 和 ,表示 Bessie 可以将各自颜色为 和 的两个珍珠配对。
8 3
2
2
4
1 3
1 3
2 3
3 2
提示
There are pearls and different colors. Two pearls have color ; two have color ; four have color .
Bessie pairs each pearl of color with one of color and .
说明:有 颗珍珠和 种不同的颜色。两颗珍珠颜色为 ,两颗珍珠颜色为 ,四颗珍珠颜色为 。
Bessie 将每颗颜色为 的珍珠与颜色为 和 的珍珠配对。
感谢