#K69477. Drone Round-Trip Minimum Battery Requirement
Drone Round-Trip Minimum Battery Requirement
Drone Round-Trip Minimum Battery Requirement
You are given N drones, where each drone has a battery consumption rate per minute provided in an array. A round-trip delivery requires M minutes. Your task is to determine the minimum battery level required for each drone to complete the round-trip. Specifically, for each drone, the minimum battery required is computed as:
$\text{battery}_i \times M$
where $\text{battery}_i$ is the consumption rate for the i-th drone. The result should be output in a single line, with the battery values separated by a single space.
Input is provided via stdin
and output should be printed to stdout
.
inputFormat
The input consists of three parts provided on a single test case:
- An integer
N
on the first line, representing the number of drones. - A line with
N
space-separated integers, each representing the battery consumption rate per minute for a drone. - An integer
M
on the next line, representing the minutes required for a round-trip.
You can assume that N ≥ 1
and M ≥ 1
.
outputFormat
Output a single line containing N
space-separated integers. Each integer is the minimum battery level required for the corresponding drone to complete the round-trip, calculated as battery_i * M
.
4
2 3 5 1
10
20 30 50 10