7 pigeons sitting on the branches, 5 pigeons under the tree
=12 in total
Upper branch has x pigeons, lower has y.
Top branch said: "If one of you flies up to us our number will be double yours":
Well, if one of the bottom branch flies up, the top branch will have x+1 birds and the bottom will have (y−1). The top will have double the bottom, so:
Top branch said: "If one of us flies down to you, our numbers will be equal":
Now, the top branch will have x−1 and the bottom y+1. The numbers should be equal:
d is the answer