1.A book seller has three types of books:English books = 175,Science books = 245,Mathematics books = 385
He wants to arrange these books into boxes.
Conditions:
- Each box must contain an equal number of English books.
- Each box must contain an equal number of Science books.
- Each box must contain an equal number of Mathematics books.
- No books should be left over. The question asks us to find:
- The greatest number of boxes required.
- The number of books of each subject in one box.
solution :
1.TO find hcf for all the three numbers(175, 245,385)
2.That is the greatest number of boxes required.
3.To divide books with hcf value to find the exact number of each subject.
eng = 175
sci = 245
maths = 385
hcf = 1
for i in range(1, eng + 1):
if eng % i == 0 and sci % i == 0 and maths % i == 0:
hcf = i
print("Greatest number of boxes:", hcf)
print("English books in each box:", eng // hcf)
print("Science books in each box:", sci // hcf)
print("Maths books in each box:", maths // hcf)
Output :
Greatest number of boxes: 35
English books in each box: 5
Science books in each box: 7
Maths books in each box: 11
Top comments (0)