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

13474번 - Boys and Girls 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB127232220.755%

문제

Bob found a nice task in his old math book for children. It says:

There are 10 children standing in a circle, 5 of them stand next to a boy, and 7 of them stand next to a girl. How is it possible?

Here is the solution to the task. If 4 boys and 6 girls stand like this: BGBGBGBGGG, there are 5 children who stand next to a boy (here they are underlined: BGBGBGBGGG), and 7 children who stand next to a girl (BGBGBGBGGG).

Now Bob wants to solve a generalized version of this task:

There are n children standing in a circle, x of them stand next to a boy, and y of them stand next to a girl. How is it possible?

Help Bob by writing a program that solves the generalized task.

입력

The single line of the input contains three integers n, x and y (2 ≤ n ≤ 100 000; 0 ≤ x, y ≤ n).

출력

If there is a solution, output a string of length n, describing the order of children in the circle. Character ‘G’ corresponds to a girl, character ‘B’ corresponds to a boy. If there are several solutions, output any of them.

If there is no solution, output “Impossible”.

제한

예제 입력 1

10 5 7

예제 출력 1

BGBGBGBGGG

예제 입력 2

10 3 8

예제 출력 2

Impossible

힌트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > NEERC Northern Subregional 2016 B번

  • 문제의 오타를 찾은 사람: bupjae
(追記) (追記ここまで)

출처

대학교 대회

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

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