#K511. Maximum Lines of Code Written by a Participant
Maximum Lines of Code Written by a Participant
Maximum Lines of Code Written by a Participant
In this problem, you are given n participants, where each participant writes code at a fixed speed per minute after an initial delay. Specifically, the i-th participant writes lines_per_minute[i] lines of code per minute starting from minute start_times[i] (i.e. they wait for start_times[i] minutes before they begin coding).
At a given minute t, the lines of code written by the i-th participant is computed as:
$$\text{lines}_i = \max\left(0, \; lines\_per\_minute[i] \times (t - start\_times[i])\right)$$
Your task is to determine the maximum number of lines of code written by any participant at minute t.
inputFormat
The input is read from standard input (stdin) and has the following format:
- An integer n representing the number of participants.
- A line with n space-separated integers representing the number of lines each participant writes per minute (lines_per_minute).
- A line with n space-separated integers representing the starting delay in minutes for each participant (start_times).
- An integer t representing the minute at which to calculate the coding progress.
outputFormat
Output a single integer to standard output (stdout), denoting the maximum number of lines of code written by any participant at minute t.
## sample3
5 3 8
0 2 1
3
16