contains category wise problems(data structures, competitive) of popular platforms.
View the Project on GitHub mayankdutta/category-wise-problems
A thief plans to rob in a shop having 2 types of toys typeA toy and typeB toy. Toys have some weight and cost. i.e. Toy A has weight given by “weightOfA” and cost given by “ValueOfA” similarly ToyB has weight given by “weightOfB” and cost given by “ValueOfB”. Shop has Infinite toys of both type. Now thief has to rob some toys from the shop such that he generates maximum cost but the problem is that the thief has to carry the toys in a truck and the truck has a capacity (maximum weight which can be load on truck) given by “cap” Now you have to help Robber to generate maximum amount such that the toys can be carried in given capacity truck.
1 <= cap <= 10^9
1 <= valueOfA <= 10^9
1 <= valueOfB <= 10^9
1 <= weightOfA <= 10^9
1 <= weightOfB <= 10^9
The only line contains 5 space separated integers denoting cap capacity of Truck), valueOfA(cost of type A toy), valueOfB(cost of type B toy), weightOfA(weight of type A toy) weightOfB(weight of type B toy) respectively.
MAX AMOUNT THAT CAN BE GENERATED
10 3 5 2 3
16