시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 956 588 460 63.800%

문제

4*N 크기의 타일을 2*1, 1*2 크기의 도미노로 완전히 채우려고 한다. 예를 들어 4*2 타일을 채우는 방법은 다음과 같이 5가지가 있다.

N이 주어졌을 때, 타일을 채우는 방법의 개수를 출력하는 프로그램을 작성하시오.

입력

첫째 줄에 테스트 케이스의 개수 T가 주어진다. T는 1,000보다 작거나 같은 자연수이다. 각 테스트 케이스는 정수 하나로 이루어져 있다. 이 정수는 문제에서 설명한 타일의 너비 N이다. N은 자연수이다.

N제한은 딱히 정해져있지 않다. 하지만, 4*N을 채우는 경우의 수가 int 범위 안에 들어오는 N만 주어진다.

출력

각 테스트 케이스에 대해 4*N크기의 타일을 채우는 방법의 경우의 수를 출력한다.

예제 입력 1

3
2
3
7

예제 출력 1

5 
11 
781
W3sicHJvYmxlbV9pZCI6IjI3MTgiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQwYzBcdWM3N2MgXHVjYzQ0XHVjNmIwXHVhZTMwIiwiZGVzY3JpcHRpb24iOiI8cD40Kk4gXHVkMDZjXHVhZTMwXHVjNzU4IFx1ZDBjMFx1Yzc3Y1x1Yzc0NCAyKjEsIDEqMiBcdWQwNmNcdWFlMzBcdWM3NTggXHViM2M0XHViYmY4XHViMTc4XHViODVjIFx1YzY0NFx1YzgwNFx1ZDc4OCBcdWNjNDRcdWM2YjBcdWI4MjRcdWFjZTAgXHVkNTVjXHViMmU0LiBcdWM2MDhcdWI5N2MgXHViNGU0XHVjNWI0IDQqMiBcdWQwYzBcdWM3N2NcdWM3NDQgXHVjYzQ0XHVjNmIwXHViMjk0IFx1YmMyOVx1YmM5NVx1Yzc0MCBcdWIyZTRcdWM3NGNcdWFjZmMgXHVhYzE5XHVjNzc0IDVcdWFjMDBcdWM5YzBcdWFjMDAgXHVjNzg4XHViMmU0LjxcL3A+XHJcblxyXG48cD5OXHVjNzc0IFx1YzhmY1x1YzViNFx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uZCB0aGUgbnVtYmVyIG9mIHRpbGluZ3Mgb2YgYSA0LWJ5LVcgZ3JpZC4gVGhlIHZhbHVlcyBvZiBXIHdpbGwgYmUgY2hvc2VuIHNvIHRoZSBjb3VudCB3aWxsIGZpdCBpbiBhIDMyLWJpdCBpbnRlZ2VyLiZuYnNwOzxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

ACM-ICPC > Regionals > North America > Greater New York Region > 2007 Greater New York Programming Contest H번

  • 문제를 번역한 사람: baekjoon
  • 잘못된 조건을 찾은 사람: jh05013