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

24789번 - Railroad 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB13912511191.736%

문제

Theta likes to play with her DUPLO railway set. The railway set she has consists of pieces of straight tracks, curved tracks, Y-shaped switches, and X-shaped level junctions, as well as bridges that allow one track to cross over another. There are also straight tracks that are railroad crossings to allow car traffic to cross.

Close-ups of some of the pieces are shown below:

To play, she picks a number of X-shaped level junctions and a number of Y-shaped switches and connects them with straight and curved pieces, using bridges as necessary.

Because the set doesn't include any bumpers, she wants to build a closed track, like all the examples shown in the manual that came with the set:

Figure 1: Various track layouts possible with the DUPLO railway system. Curved pieces are shown in green, straights in red, switches in orange, level junctions in yellow, bridges in blue, and crossings in black. DUPLO is a trademark of the LEGO Group.

Unfortunately, sometimes, this doesn't seem to work with the number of X-shaped level junctions and Y-shaped switches she starts out with.

She quickly figures out exactly when it is possible to build a closed track - can you figure it out, too?

Write a program that outputs if it is possible to build a railroad that does not require any bumpers (i.e., which does not have any dead-end tracks).

입력

The input consists of a single test case with two integer numbers $X$ (0ドル \le X \le 1000$) and $Y$ (0ドル \le Y \le 1000$) denoting the number of level junctions and switches, respectively. You may assume that Theta has sufficiently many straight and curved pieces as well as bridges.

출력

Output possible if she can build a closed track using all level junctions and all switches without any dead ends, or impossible otherwise.

제한

예제 입력 1

1 0

예제 출력 1

possible

예제 입력 2

0 2

예제 출력 2

possible

예제 입력 3

1 3

예제 출력 3

impossible

힌트

출처

School > Virginia Tech High School Programming Contest > 2016 Virginia Tech High School Programming Contest G번

  • 문제를 만든 사람: Godmar Back
(追記) (追記ここまで)

출처

대학교 대회

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

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