You have a tanker that can hold any amount of water. You have $n$ taps that either let in or let out water. The rate of flow of water (in $ml/min$) for each tap is given by $f_n$ (positive for inflow, negative for outflow). The tank initially has $x\ ml$ and you must bring it to a state of $y\ ml$.
Values of $f_n$ are real numbers and $n,x,y$ are integers. Taps are opened or closed only once every minute: no action can be taken except when the second hand of the clock is at $0$. Any number of taps can be closed or opened simultaneously. All these values are given to you.
Q1: What is the fastest algorithm to find a solution (or find that one does not exist)?
Q2: Such questions when put to other humans are usually not that hard (as compared to those put to a computer). Can you suggest some tricks that a person can use to solve such questions faster?
Q3: What if there are initially $k$ taps open and when you open taps, you must also simultaneously close taps, such that exactly $k$ taps remain open throughout.
(I hope I haven't clubbed too many questions together. This Q may require some serious math, please explain your conclusions in simple words also.)