Răspuns:
#include <iostream>
using namespace std;
int main()
{
int a, b, h, x, y;
cin >> a >> b >> h;
x = a;
while (x>=a && x<=b)
y = 3*x+1;
x = x+ h;
cout << y << " ";
}