Hello Codeforces, I have a question which I am unable to solve, please help me:
There is 2d Matrix of size h*w representing the city. Each cell can be 0,1,2,3,4 0-> road 1->Tree 2->Garage 3-> warehouse 4-> Airport
There is a truck parked at the Garage, Truck’s task is to go to the warehouse (one or many at a time) , load the goods and unload the truck at the airport. There is no limit on the number of goods a truck can carry.
There is a cost associated with a truck. Cost is (Number of blocks it has moved * (1+Number of goods truck carries)) like To move one block cost is 1 on an empty truck in Cost is 2 if truck has 1 good 3 if the truck has 2 goods. ………. You have to tell how many maximum goods can be unloaded at airport using at max C cost
Constraints Number of test cases — 50 h,w belongs to (2,40) c belongs to (5,2000) There can be at max 13 warehouses Truck cannot pass a tree, if it is at any warehouse truck can or cannot load the goods, similarly if it's at an airport it's not necessary to unload the goods. But starting point is fixed is garage.
Any idea on how to solve it would be great



