Q1 : You have three measuring jugs A, B and C. The measuring marks have worn out, so it is impossible to measure exact volumes. Specifically, each time you measure with A, all you can be sure of is that you have a volume that is in the range [230, 240) mL. The next time you use A, you may get a different volume - all that you know with certainty is that the quantity will be in (230-240) mL. Jugs B and C can be used to measure a volume in [290, 310] and [500, 515) mL respectively. Your recipe for cookies calls for at least 2100 mL and no more than 2300 mL.
WAP to determine if there exists a sequence of steps by which the required amount of milk can be obtained using the worn-out jugs. The milk is being added to a large mixing bowl and cannot be removed from the bowl. You cannot pour one jug's contents into another. Your scheme should always work, returning 2100-2300 mL of milk, independent of how much is chosen in each individual step, as long as that quantity satisfies the constraints.
Q2 : You are given an array A of integers and are asked to find the largest product that can be made by multiplying all but one of the entries in A. You cannot use an entry more than once. Example: A = {3,2,5,4}, result is 60.
A = {3,2,-1,4}, result is 24. A = {3,2,-1,4,-1,6}, result is 72.