III Olympiad in Informatics 1995/1996
|
Task: FIB
|
Author: Wojciech Rytter
|
II stage contest |
Fibonacci words are defined similarly to Fibonacci numbers:
FIB1 = b FIB2
= a FIBk+2 = FIBk+1*FIBk
for k >= 1,
where * denotes operation of connecting words (concatenation).
Hence we have:
FIB3 = ab; FIB4 = aba;
FIB5 = abaab; FIB6 = abaababa.
In the output file FIB.OUT should be written one integer:
3
Your program should look for the file FIB.IN in the current directory and produce the output file FIB.OUT in the current directory too. The file containing the source code of your program should have a name FIB.???, whereas you should put three-letter abbreviation of the used programming language name instead of ???. The same program in executable form should be written in the file FIB.EXE