Question 23 || Hacker Rank
Boxes through a Tunnel || Hacker Rank
You are
shipping a few boxes through a passage, where each case is a parallelepiped,
and is described by its length, width and level.
The level of
the passage 41 feet and the width can be thought to be endless. A
container can be helped through the passage provided that its level is
completely not exactly the passage's level. Find the volume of each container
that can be effectively moved to the opposite finish of the passage. Note:
Boxes can't be pivoted.
Input
Configuration
The main
line contains a solitary whole number n, meaning the quantity of boxes.
n lines follow with three whole numbers on
each isolated by single spaces - lengthi, widthiand
heighti which are length, width and level in feet of the i-th
box.
Requirements
Yield
Arrangement
For each
container from the info which has a level lesser than 41 feet, print its
volume in a different line.
Test
Information 0
4
5 5 5
1 2 40
10 5 41
7 2 42
Test
Result 0
125
80
Clarification
0
The primary
box is extremely low, just 5 feet tall, so it can go through the passage
and its volume is 5 x 5 x 5 = 125.
The
subsequent box is adequately low, its volume is 1 x 2 x 40 = 80.
The third
box is precisely 41 feet tall, so it can't pass. The equivalent can be
said about the fourth box.
0 Comments