//https://github.com/mostafa-saad/MyCompetitiveProgramming/blob/master/Olympiad/MCO/official/2016/editorial.pdf
#include<queue>
#include<map>
#include <string>
#include<bits/stdc++.h>
#define pi 3.141592654
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define input ios_base::sync_with_stdio(0);cin.tie(0);
//#define x real()
//#define y imag()
using namespace std;
typedef pair<double,double>pdd;
typedef long long ll;
typedef pair<ll, ll>pii;
//typedef complex<double> point;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<30> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//#define var(x) ((x)<<1)
//#define nvar(x) ((x)^1)
const int N=100000,M=100000;
ll n,x,l,q;
main()
{
//cout<<Pow((ll)1000000,(ll)110);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
// char input[15];
// scanf("%s", &input); array of char
// gets(c+1); array of char
//printf("%s, ",name[k[i]].c_str()); printf of string
//priority_queue<ll,vector<ll>,greater<ll>>y;
input;
cin>>q;
while(q--)
{
cin>>x>>l>>n;
cout<<2*n*(l/(2*n)+1)+__popcntd(x)<<endl;
}
return 0;
}
Compilation message
cats.cpp:27:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main()
^
cats.cpp: In function 'int main()':
cats.cpp:45:27: error: '__popcntd' was not declared in this scope
cout<<2*n*(l/(2*n)+1)+__popcntd(x)<<endl;
^~~~~~~~~
cats.cpp:45:27: note: suggested alternative: '__round'
cout<<2*n*(l/(2*n)+1)+__popcntd(x)<<endl;
^~~~~~~~~
__round