This is a problem on codeforces and I have submitted a solution and I got TLE. How to remove TLE
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
unsigned int y, k, n;
set <int> s;
cin >> y >> k >> n;
if (y >= n)
{
cout << -1; return 0;
}
for (int i = y + 1; i <= n; i++)
{
if (i%k == 0)
{
s.insert(i - y);
}
}
if (s.begin() == s.end())
{
cout << -1; return 0;
}
for (auto x : a)
cout << x << " ";
}