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

11366번 - Tons of Orcs, no Fibbin’ 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB6441299923.855%

문제

The armies of Mordor are fearsome in both stature and numbers. How did they raise such a host in so short a time? It turns out, orcs breed very quickly. For any given year, their population equals the sum of the populations from the previous two years. For example, if there are 14 orcs in year 7 and 20 orcs in year 8, then we can calculate a total population of 34 orcs in year 9, and a total population of 54 orcs in year 10. Given the populations in two previous years, calculate the population at the nth following year.

입력

Each test case is on its own line, each of the form a b c; Here a and b are non-negative integers denoting the number of orcs in the previous two years, and c is the number of years in the future to calculate the population in. The end of input is marked by a line of the form ”0 0 0”, which should produce no output. No values will exceed the value that can be stored in an int variable.

출력

For each test case, output one integer on its own line describing the number of orcs in the specified year. No values will exceed the value that can be stored in an int variable.

제한

예제 입력 1

10 10 1
0 39 4
14 20 1
0 0 0

예제 출력 1

20
195
34

힌트

출처

School > University of Virginia High School Programming Contest > UVa HSPC 2014 B번

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

출처

대학교 대회

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

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