#P2902. [USACO08MAR] Pearl Pairing G
[USACO08MAR] Pearl Pairing G
Description
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.
Input Format
Line : Two space-separated integers: and .
Lines : Line tells the count of pearls with color : .
Output Format
Lines : Line contains two integers and indicating that Bessie can pair two pearls with respective colors and .
8 3
2
2
4
1 3
1 3
2 3
3 2
Hint
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 .
京公网安备 11011102002149号