My issue
where the code is getting wrong infact im satisfying all the conditions
My code
#include <bits/stdc++.h>
using namespace std;
void solve(){
long long n,l;
cin>>n>>l;
vector<long long>v;
long long k=l;
for(int i=0;i<n;i++){
if(v.size()==n) break;
v.push_back(l+1);
if(v.size()==n) break;
v.push_back(2*(l+1)+1);
l=(2*(l+1)+1+k);
}
for(int i=0;i<n;i++){
cout<<v[i]<<" ";
}
cout<<endl;
}
int main() {
int t;
cin>>t;
while(t--){
solve();
}
// your code goes here
}
Problem Link: Anti-Triangle Practice Coding Problem - CodeChef