hello everyone,
I solved this problem
https://www.spoj.pl/problems/FIBOSUM/
but i am getting wa.
Here is my code
#include <iostream>
#include <cmath>
#define phi 1.61803398874989484820458683436563811772030917980576286213544862270526046281890244970720720418939113748475408807538689175212663386222353693179318006076672635443338908659593958290563832266131992829026788
using namespace std;
long int sum_fibonacci(long int n){
return round((pow(phi,n+2)/sqrt(5)));
}
int main(){
int t,i=0;
long int n,m,ans=0;
cin>>t;
while(i<t)
{
cin >> n >> m;
ans=sum_fibonacci(m) - sum_fibonacci(n-1);
ans = ans % 1000000007;
cout<< ans << endl;
i++;
}
return 0;
}
can someone give me some more tricky test cases?????