When two people or machines, etc., work together, theirspeedsadd. Let T be the time, in hours, it takes T hours for B to fill the bottles so its speed is 1/T (jobs/hour). Since A works twice as fast, its speed it 2/T. Working together they have speed 1/T+ 2/T= 3/T. Since it took them 2 two hours to do the job together we know their speed together is really 1/2 job/hour.

3/T= 1/2. Solve for T.

(This time I got in before earboth!)