AIRLINES - Editorial

PROBLEM LINK:

Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4

Author: notsoloud
Testers: iceknight1093, rivalq
Editorialist: iceknight1093

DIFFICULTY:

TBD

PREREQUISITES:

None

PROBLEM:

Chef has 10 airplanes, each with X seats.
Y passengers want to book a seat, and each seat costs rupees Z.
How much money can Chef earn?

EXPLANATION:

10 airplanes with X seats each gives Chef a total of 10\cdot X seats.

Since Y people want to book a seat, the best Chef can do is to sell \min(Y, 10\cdot X) seats.

With each seat costing Z rupees, Chef thus earns

Z\times \min(Y, 10\cdot X)

rupees.

TIME COMPLEXITY

\mathcal{O}(1) per test case.

CODE:

Editorialist's code (Python)
for _ in range(int(input())):
    x, y, z = map(int, input().split())
    print(z * min(y, 10*x))