Question: Mr Jack The Builder
Mr. Jack is laying down a row of bricks whose length is target inches. Mr. Jack has 2 types of bricks: small bricks (1 inch each) and big bricks (5 inch each). He wants to know if the number of small bricks and big bricks he has is enough.
If a brick is being used, it has to be used fully and not in parts.
Write a method Met that takes in 3 integers:
first integer has the value of target
second integer has number of big bricks
third integer has number of small bricks
The method should print Possible if the number of bricks are enough. Otherwise print Impossible.
Only write the method - assume that the Class & main method have been defined.
Use the System.out.println() statement for printing.
Example Input: 5 2 1
Output: Possible
Example Input: 10 0 10
Output: Possible
Example Input: 13 2 5
Output: Possible
Example Input: 13 3 0
Output: Impossible
Example Input: 13 2 0
Output: Impossible
Answers
Answered by
10
beacuse
4:66
and
5:7::5:8
hope it helps u
4:66
and
5:7::5:8
hope it helps u
Answered by
0
Answer:
def solve(target, big, small):
if big*5+small<target:
print("Impossible")
elif big*5+small>=target and (target-big*5)<=small:
print("Possible")
else:
print("Impossible")
Explanation:
Similar questions