why this code given wrong answer plz help,
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;cin>>t;
while(t–)
{
unsigned long long n,k,ans;
cin>>n>>k;
if(k%2==0)
{
ans=(n+((k/2)-1))(n+(k/2))+n;
}
else
{
ans=(n+(k/2))(n+(k/2)+1)-n;
}
cout<<ans<<endl;
}
return 0;
}