Just think of being 20 network bits as already given in the question.
remaining 32-20 = 12 bits for the host
total number of hosts possible is 2^12
In that A takes half so 2^12/2 = 2^11 each is divided and one part is given to A
the other part of 2^11 is divided further as 2^11/2 = 2^10 each where that becomes the quater of 2^12 so that is given to B
If all the above classification is done the number of bits borrowed is calculated first:
1 bit is borrowed for A so network bits becomes 21 and for B its 2 bit borrowed so it becomes 22.
By this option C and D eliminates
Now in option A we can say that
For A, first bit borrowed from host is set to one where this makes the third octet of the IP as
10001000 and ranges from 136 to 151(136 +15) hence IP it has 245.248.136.0/21
further for B two bits are borrowed and first bit must be 0 (as 1 is taken above) so the third octet of IP looks like :
10000000 and ranges from 128 to 131(128 + 3) hence IP it has and 245.248.128.0/22
Hence Option A satisfies.
This is a repeated gate question and also if still it’s not clear I can plot the diagram of the division of subnets and show how it is been classified
Open for any corrections !!