For me:
Quiet environment, preferably around others who are also silently studying as it encourages me. The library is the best place. To prevent daydreaming, think about failure as a result of daydreaming. You could also try to break up revision such as different modules/topics throughout the day so it doesn't get boring, and designated breaks to refresh your mind. Also, try different revision techniques.
As for the hours of A's question, well, that's all dependant on you and your ability. Only you or your teachers know the answer to this. Ultimately, the more productive hours you put in, the higher your chances of an A.