NPTEL Programming Assignment: T2-Q2
You are given a positive integer N <= 1000.
You have to see whether N is the tenth number in some series obtained by selecting N[1] and N[2] to be some positive integer, where N[1] <= N[2], and then using the following relation to compute N[3], N[4], ... N[10]:
N[k]=N[k-1]+N[k-2], where 3 <= K <= 10.
If there is such a series, then you must output N[1] and N[2] with a space in between.
If there is no such series, output -1 -1.
199
3 4
5
-1 -1
52
-1 -1
550
10 10