시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
5 초 512 MB 17 9 9 52.941%

문제

N-오미노는 이차원 평면 위에 N개의 정사각형이 연결된 도형이다. 1-오미노는 1*1 크기의 정사각형이다. 그래서 n-노미노는 n - 1오미노에 1-오미노, 즉 1*1짜리 정사각형을 추가 한 것과 같다. 단, 두 N-오미노가 합동이면 같다고 가정한다.

아래에는 가능한 5가지 4-오미노가 있다.

images-73.png

아래에는 전체 108가지의 7-오미노 중 일부가 있다.

images-74.png

철수와 동수는 변수 X, R, C가 정해진 상태에서 아래의 절차대로 게임을 진행하려고 한다.

1.철수는 가능한 X-오미노 중에서 하나를 고른다.                                    

2.동수는 여러가지 X-오미노를 이용해서 넘치지도 부족하지도 않게 R*C 판을 채운다. 단, 철수가 고른 X-오미노를 적어도 한개를 이용해야 하며 X-오미노를 뒤집거나 회전하여 이용해도 된다. 동수가 위의 조건을 만족하면서 판을 채우면 동수는 승리하고 판을 채우지 못하면 패배한다.

X, R, C가 주어질때 철수가 무조건 이길지 동수가 무조건 이길지 판별하라.

입력

입력의 첫째 줄에는 테스트케이스의 수 T가 주어진다

다음 T개의 줄에서는 각각 X, R, C가 차례대로 주어진다.

1 ≤ T ≤ 100, 1 ≤ X, R, C ≤ 20

출력

각각의 테스트케이스에 대하여 "Case #x:y"를 출력한다. 이때 x는 테스트케이스 번호(1부터 시작한다). 철수가 선택했을때 무조건 이기는 X-오미노가 하나라도 있으면 y는 RICHARD이고 하나도 없으면 y는 GABRIEL이다.

예제 입력 1

4
2 2 2
2 1 3
4 4 1
3 2 3

예제 출력 1

Case #1: GABRIEL
Case #2: RICHARD
Case #3: RICHARD
Case #4: GABRIEL

힌트

Case #1에서는 철수는 선택할 수 있는 2-오미노가 하나 밖에 없다--1*2짜리 직사각형. 2*2판은 1*2 직사각형 두개로 무조건 채울수 있으므로 동수 승!

Case #2에서도 철수는 선택할 수 있는 2-오미노가 하나 밖에 없다--1*2짜리 직사각형. 하지만 동수가 그 2-오미노를 어느것에 놓더라도 1*1이 하나 남으므로 철수 승!

Case #3에서 철수가 이길수 있는 방법은 2*2짜리 4-오미노를 선택하는 것이다. 1*4판에다가 2*2정사각형은 절대 넣을 수 없으므로 철수 승!

Case #4에서는 1*3짜리 3-오미노 또는 L모양으로 생긴 3-오미노를 선택해야 한다. 두 경우 모두 동수가 2*3판에 하나를 놓고 똑같은 모양 하나를 더 넣으면 되므로 동수 승!

W3sicHJvYmxlbV9pZCI6IjEyMTczIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiTi1cdWM2MjRcdWJiZjhcdWIxNzggXHVkMzEwIFx1Y2M0NFx1YzZiMFx1YWUzMCAoTGFyZ2UpIiwiZGVzY3JpcHRpb24iOiI8cD5OLVx1YzYyNFx1YmJmOFx1YjE3OFx1YjI5NCBcdWM3NzRcdWNjMjhcdWM2ZDAgXHVkM2M5XHViYTc0IFx1YzcwNFx1YzVkMCBOXHVhYzFjXHVjNzU4IFx1YzgxNVx1YzBhY1x1YWMwMVx1ZDYxNVx1Yzc3NCBcdWM1ZjBcdWFjYjBcdWI0MWMgXHViM2M0XHVkNjE1XHVjNzc0XHViMmU0LiAxLVx1YzYyNFx1YmJmOFx1YjE3OFx1YjI5NCAxKjEgXHVkMDZjXHVhZTMwXHVjNzU4IFx1YzgxNVx1YzBhY1x1YWMwMVx1ZDYxNVx1Yzc3NFx1YjJlNC4gXHVhZGY4XHViNzk4XHVjMTFjIG4tXHViMTc4XHViYmY4XHViMTc4XHViMjk0IG4gLSAxXHVjNjI0XHViYmY4XHViMTc4XHVjNWQwIDEtXHVjNjI0XHViYmY4XHViMTc4LCBcdWM5ODkgMSoxXHVjOWRjXHViOWFjIFx1YzgxNVx1YzBhY1x1YWMwMVx1ZDYxNVx1Yzc0NCBcdWNkOTRcdWFjMDAgXHVkNTVjIFx1YWM4M1x1YWNmYyBcdWFjMTlcdWIyZTQuIFx1YjJlOCwgXHViNDUwIE4tXHVjNjI0XHViYmY4XHViMTc4XHVhYz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oZXIgY29weSBvZiB0aGUgc2FtZSAzLW9taW5vIHRvIGZpbGwgaW4gdGhlIHJlbWFpbmluZyBob2xlLjxcL3A+XHJcbiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

Contest > Google Code Jam > Google Code Jam 2015 > Qualification Round D2번

채점

  • 예제는 채점하지 않는다.