Pretty easy.
Projectile motion follows S = (1/2)at^2 +v_0t + s_0
s_0 = 0 in this game, as we're dealing with standing on the ground throwing up.
We'd like our maximum V = at + v_0 to be when the bag reaches the window at height 10.
At this time we have 0 = at + v_0 and thus v_0 = -at
Thus, we're looking at:
10 = 1/2(-9.8)t^2 +v_0t
simplifying and moving to one side gives us
-4.9t^2 + v_0t - 10 = 0
Substituting for v_0 we get:
-4.9t^2 - 9.8t -10 = 0
Use the quadratic formula to determine the roots here.
That gives you a time,
This will give you a time, and then plug this time into our equation v=-9.8t to get the velocity
This is the velocity in the upward direction. To figure out then the overall velocity use your 30-60-90 sine/cosine geometry.
We want the hypotenuse, and now we have the opposite. Thus, we do sin(60)=v_0/V
V = v_0/sin(60)
To determine the adjacent (horizontal) velocity just use tan instead