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

26529번 - Bunnies 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB106680975176.089%

문제

You’re going to raise farm animals and you decided to start with bunnies, the easiest of animals. To your surprise they are breeding like rabbits, so much so that you’re unable to count them accurately. However, you know that rabbits’ breeding patterns always follow the Fibonacci sequence. The Fibonacci sequence is defined as follows:

F(0) = 1, F(1) = 1, F(N) = F(N-1)+F(N-2)

Given the number of months the rabbits have been breeding, use the Fibonacci sequence to determine the number of rabbits you should have.

입력

The first line will contain a single integer n that indicates the number of data sets that follow. Each data set will start with a single integer x denoting the number of months that have passed since you bought your initial pair of rabbits. 0≤x≤45

출력

For each test case, output the expected number of rabbits after x months.

제한

예제 입력 1

3
0
5
45

예제 출력 1

1
8
1836311903

힌트

출처

School > PLU High School Programming Contest > PLU 2017 > Novice 2번

School > PLU High School Programming Contest > PLU 2017 > Advanced 2번

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

출처

대학교 대회

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

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