Fibonacci Modified



Download 188,01 Kb.
Pdf ko'rish
Sana19.04.2022
Hajmi188,01 Kb.
#563220
Bog'liq
fibonacci-modified-English



Fibonacci Modified
We define a 
modified 
Fibonacci sequence
using the following definition:
Given terms and 
where 
, term 
is computed using the following relation:
For example, if term 
and 
, term 
, term 
, term 
, and so on.
Given three integers, , , and , compute and print term 
of a 
modified Fibonacci sequence.
Note: The value of may exceed the range of a 
-bit integer. Many submission languages have
libraries that can handle such large results but, for those that don't (e.g., C++), you will need to be more
creative in your solution to compensate for the limitations of your chosen submission language.
Input Format
A single line of three space-separated integers describing the respective values of , , and .
Constraints
may exceed the range of a 
-bit integer.
Output Format
Print a single integer denoting the value of term 
in the modified Fibonacci sequence where the first two
terms are and .
Sample Input
0 1 5
Sample Output
5
Explanation
The first two terms of the sequence are 
and 
, which gives us a modified Fibonacci sequence
of 
. Because 
, we print term , which is .

Document Outline

  • Fibonacci Modified

Download 188,01 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©www.hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish