Hi Derin,
I solved your question on a piece paper. In addition, I shared the official markscheme of your question from IB Questionbanks. If you don't understand my solution, you can contact me via DM or reply under this discussion.
My Solution:

Markscheme for question A:

Markscheme for question B:

Good luck!