Wrong answer in "Chef and Walk"

Can someone tell me how my code give wrong answer
#include<bits/stdc++.h>
using namespace std;

int main()
{
int t;
cin>>t;
while(t–)
{
long long int n,k,a,b,block,sum=0;
int mod=1000000007;
cin>>n>>k;
a=(nn)%mod;
sum+=a;
b=n
2;
block=(k/2)b;
long long int d=(k-1)/2;
sum=(sum+block+d
(d+1))%mod;
cout<<sum<<endl;
}
return 0;
}
In this question

i aready compare the submitted answer with my code and it give the right output.

Tell how my code is wrong??