fork download
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define GG ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int main () { GG;
ll x=1,y,k,n;	bool f=0;
cin>>y>>k>>n;

if( (x+y)%k != 0)
x+= k-( (x+y)%k);

while( (y+x)<=n)
{ cout<<x<<" ";
  f=1;
 x+=k;
}
if(!f) cout<<"-1";
return 0;}
Success #stdin #stdout 0.01s 5280KB
stdin
10 1 11
stdout
1