Both problems depend on the region you will be working with, let us fist consider the first problem:

We consider the region

next consider the region

The second problem can be done in a similar fashion, just consider the regions of interest separately, namely

i.

ii.

iii.

you can then also make use of the following decomposition

Now you will easily be able to find the solutions