The candles each take one hour to burn completely. Cutting off bits of the candles is forbidden, but the candles are placed on a raft of fork handles so they may be burnt at both ends (e.g. to time $1/2$ hour burn a candle at both ends). You are also allowed to weld n candles to each other and light x ends if $x<2n$ (e.g. $2/3$ hours can be timed by welding $2$ candles and lighting $3$ ends) to get a fraction of $\frac{n}{x}$. 1/16 hours can be timed with four candles by lighting all the candles at one end, and the first candle at both ends. When that candle is burnt light the second candle at the other end. Then light the third at the other end, then the fourth which will take 1/16 hours to finish burning.
Given any rational number of hours, what is the fastest way to determine the minimum number of candles needed?