Logo
(追記) (追記ここまで)

6173번 - Pearl Pairing 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB241897133.649%

문제

At Bessie's recent birthday party, she received N (2 <= N <= 100,000; N%2 == 0) pearls, each painted one of C different colors (1 <= C <= N).

Upon observing that the number of pearls N 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.

입력

  • Line 1: Two space-separated integers: N and C
  • Lines 2..C + 1: Line i+1 tells the count of pearls with color i: C_i

출력

  • Lines 1..N/2: Line i contains two integers a_i and b_i indicating that Bessie can pair two pearls with respective colors a_i and b_i.

제한

예제 입력 1

8 3
2
2
4

예제 출력 1

1 3
1 3
2 3
3 2

힌트

Bessie pairs each pearl of color III with one of color I and II.

출처

Olympiad > USA Computing Olympiad > 2007-2008 Season > USACO March 2008 Contest > Gold 3번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /