score:2
If you apply for 2-entry Schengen visa, the visa will cover the whole duration of your stay in Europe. Note the 2-entry restriction: it will be impossible for you to make more than 1 trip to the UK from the Schengen area.
Getting a UK visa is (generally) harder, so it's better to apply for a UK visa first.
Upvote:2
The limitation you may run into is "entries".
Schengen visas can be single entry (lets you enter only once), double entry (lets you enter twice) or multiple entry (lets you enter as many times as needed within the validity period). UK visas can be single entry or multiple entry (I don't think the UK does double entry visas though i'm not 100% sure on that).
The UK and Schengen have seperate border controls. So going from one to the other counts as a new entry.
So home->Schengen->UK->Schengen->UK->Schengen->home would mean three entries into Schengen and two entries in the UK which afaict means you would need multiple entry visas from both the UK and schengen.
Will they let you have those? I don't have personal experiance but I expect it depends heavilly on your circumstances. AIUI some embasies are reluctant to give multiple-entry visas to first time travellers.