시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1359 921 844 69.465%

문제

상근이는 길을 걷다가 신기한 기계를 발견했다. 기계는 매우 매우 큰 화면과 버튼 하나로 이루어져 있다.

기계를 발견했을 때, 화면에는 A만 표시되어져 있었다. 버튼을 누르니 글자가 B로 변했다. 한 번 더 누르니 BA로 바뀌고, 그 다음에는 BAB, 그리고 BABBA로 바뀌었다. 상근이는 화면의 모든 B는 BA로 바뀌고, A는 B로 바뀐다는 사실을 알게되었다.

버튼을 K번 눌렀을 때, 화면에 A와 B의 개수는 몇 개가 될까?

입력

첫째 줄에 K (1 ≤ K ≤ 45)가 주어진다.

출력

첫째 줄에 A의 개수와 B의 개수를 공백으로 구분해 출력한다.

예제 입력 1

1

예제 출력 1

0 1

힌트

W3sicHJvYmxlbV9pZCI6Ijk2MjUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJCQUJCQSIsImRlc2NyaXB0aW9uIjoiPHA+XHVjMGMxXHVhZGZjXHVjNzc0XHViMjk0IFx1YWUzOFx1Yzc0NCBcdWFjNzdcdWIyZTRcdWFjMDAgXHVjMmUwXHVhZTMwXHVkNTVjIFx1YWUzMFx1YWNjNFx1Yjk3YyBcdWJjMWNcdWFjYWNcdWQ1ODhcdWIyZTQuIFx1YWUzMFx1YWNjNFx1YjI5NCBcdWI5ZTRcdWM2YjAgXHViOWU0XHVjNmIwIFx1ZDA3MCBcdWQ2NTRcdWJhNzRcdWFjZmMgXHViYzg0XHVkMmJjIFx1ZDU1OFx1YjA5OFx1Yjg1YyBcdWM3NzRcdWI4ZThcdWM1YjRcdWM4MzggXHVjNzg4XHViMmU0LjxcL3A+XHJcblxyXG48cD5cdWFlMzBcdWFjYzRcdWI5N2MgXHViYzFjXHVhY2FjXHVkNTg4XHVjNzQ0IFx1YjU0YywgXHVkNjU0XHViYTc0XHVjNWQwXHViMjk0IEFcdWI5Y2MgXHVkNDVjXHVjMmRjXHViNDE4XHVjNWI0XH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iZuYnNwOzxiciBcLz5cclxuJm5ic3A7PGJyIFwvPlxyXG5BbXVzZWQgYnkgdGhlIG1hY2hpbmUsIE1pcmtvIGFza2VkIHlvdSBhIHZlcnkgZGlmZmljdWx0IHF1ZXN0aW9uISBBZnRlciBLIHRpbWVzIG9mIHByZXNzaW5nIHRoZSBidXR0b24sIGhvdyBtdWNoIGxldHRlcnMgQSBhbmQgaG93IG11Y2ggbGV0dGVycyBCIHdpbGwgYmUgZGlzcGxheWVkIG9uIHRoZSBzY3JlZW4/Jm5ic3A7PFwvcD5cclxuIiwiaW5wdXQiOiI8cD5UaGUgZmlyc3QgbGluZSBvZiBpbnB1dCBjb250YWlucyB0aGUgaW50ZWdlciBLICgxICZsZTsgSyAmbGU7IDQ1KSwgdGhlIG51bWJlciBvZiB0aW1lcyBNaXJrbyBwcmVzc2VkIHRoZSBidXR0b24uJm5ic3A7PFwvcD5cclxuIiwib3V0cHV0IjoiPHA+VGhlIGZpcnN0IGFuZCBvbmx5IGxpbmUgb2Ygb3V0cHV0IG11c3QgY29udGFpbiB0d28gc3BhY2Utc2VwYXJhdGVkIGludGVnZXJzLCB0aGUgbnVtYmVyIG9mIGxldHRlcnMgQSBhbmQgdGhlIG51bWJlciBvZiBsZXR0ZXIgQi4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

Contest > Croatian Open Competition in Informatics > COCI 2013/2014 > Contest #3 1번

  • 문제를 번역한 사람: baekjoon
  • 문제의 오타를 찾은 사람: hahaha