Language: C++

#include<iostream>
#include<string>
using namespace std;

int time[501];

int main()
{
	int n, c[101], s[100001], f[101];

	cin >> n;

	if (n == 1)
	{
		cout << 0 << endl;
		return 0;
	}

	for (int i = 1; i < n; i++)
	{
		cin >> c[i] >> s[i] >> f[i];
	}

	int k = 0;

	for (int i = 1; i < n; i++)
	{
		time[i] = c[i] + s[i];

		for (int j = i + 1; j < n; j++)
		{
			while (1)
			{
				if (s[j] + f[j] * k >= time[i]) break;
				k++;
			}

			time[i] = s[j] + f[j] * k;
			k = 0;

			time[i] += c[j];
		}
	}

	for (int i = 1; i < n; i++)
	{
		cout << time[i] << endl;
	}

	cout << 0 << endl;
}

Compiler output:
a.cc:5:13: error: 'int time [501]' redeclared as different kind of entity
    5 | int time[501];
      |             ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:28:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                 time[i] = c[i] + s[i];
      |                       ^
a.cc:28:25: error: assignment of read-only location '*(time + ((sizetype)i))'
   28 |                 time[i] = c[i] + s[i];
      |                 ~~~~~~~~^~~~~~~~~~~~~
a.cc:34:62: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   34 |                                 if (s[j] + f[j] * k >= time[i]) break;
      |                                                              ^
a.cc:34:53: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |                                 if (s[j] + f[j] * k >= time[i]) break;
      |                                     ~~~~~~~~~~~~~~~~^~~~~~~~~~
a.cc:38:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |                         time[i] = s[j] + f[j] * k;
      |                               ^
a.cc:38:33: error: assignment of read-only location '*(time + ((sizetype)i))'
   38 |                         time[i] = s[j] + f[j] * k;
      |                         ~~~~~~~~^~~~~~~~~~~~~~~~~
a.cc:41:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   41 |                         time[i] += c[j];
      |                               ^
a.cc:41:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   41 |                         time[i] += c[j];
      |                         ~~~~~~~~^~~~~~~
a.cc:41:33: error: assignment of read-only location '*(time + ((sizetype)i))'
a.cc:47:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   47 |                 cout << time[i] << endl;
      |                               ^