Please enter your email address or userHandle.
Given an equation of the form F(n) = F(n-2) + F(n-3) where F(0) = 1, F(1) = 0, F(2) = 1 , the task is to find the nth term of this sequence.
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains an integer N.
For each test case in a new line print the nth term of the sequence mod 10^9+7.
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.