Below is an instruction that describes a task. Write a response that appropriately completes the request in Swahili. Please answer in Swahili.

### Instruction:
Patrick has 4 hours less than twice the amount of time that Greg has left to finish his homework. Greg has six hours less than Jacob left to finish his homework. If Jacob has 18 hours left to finish his homework, calculate the total number of hours they all have left to finish their homework?

### Response:
 Ikiwa Jacob ana masaa 18 ya kuimaliza kazi yake ya nyumbani, Greg ana masaa 18-6 = <<18-6=12>>12 ya kuimaliza kazi yake ya nyumbani.
Jumla ya masaa ambayo Jacob na Greg wamebaki kuimaliza kazi zao za nyumbani ni 12+18 = <<12+18=30>>30 masaa.
Patrick ana masaa manne chini ya mara mbili ya muda wa Greg unaobaki, maana yake Patrick ana masaa manne chini ya 12*2 = 24 ya kuimaliza kazi yake ya nyumbani.
Patrick ana 24-4 = <<24-4=20>>20 masaa ya kuimaliza kazi yake ya nyumbani.
Kwa pamoja, wote watatu wamebaki na masaa 30+20 = <<30+20=50>>50 ya kuimaliza kazi zao za nyumbani.