Let $E$ be on $BC$ so $CE = CD$. Then $\angle DEC = 80^{\circ}$ so $CADE$ is cyclic, so we have by the power of the point with respect to $B$: $$a\cdot (a-d) = b\cdot (b-x)\;\;\;\;\;\;\;\;\;\;\;\;(1)$$
By angle bisector theorem we have $${b-x\over x} = {a\over b}\implies b(b-x)= ax\;\;\;\;\;\;\;\;(2)$$
By (1) and (2) we have $$a(a-d)= ax \implies a-d= x$$
Since we are searching for $d+x = a= 2017$ we are done.
Assuming Zunayed has more chocolates than Pial and at the end it is not required to have $P<Z<B$, but only the intermediate steps. (Pial is not to blame if Zunayed decided to give away chocolates to Bindu).
Pial gives half of his 20 chocolates to Zunayed so that Zunayed has more chocolates (than Pial).
Can Zunayed have 3 chocolates? No, because Pial can give 9 chocolates so that $Z=12>11=P$. (According to the condition, Pial must give 10 and keep $\color{red}{10}$).
Can Zunayed have 2 chocolates? Yes, Zunayed has $\color{red}{2}$ chocolates.
Can Zunayed have 1 chocolate? No, because Zunayed gets 10 from Pial to have 11 in total, however, Zunayed can not give half of it to Bindu (it is assumed a chocolate is indivisible).
Zunayed gives half of his chocolates to Bindu so that Bindu has more chocolates than Zunayed.
First note that Zunayed has 12 chocolates after receiving 10 from Pial.
Can Bindu have 3 chocolates? No, because Zunayed has 12 chocolates and Zunayed can give 5 to Bindu, because $B=8>7=Z$. (According to the condition, Zunayed must give 6).
Can Bindu have 2 or 1 chocolates? Yes, Bindu has $\color{red}{2}$ or $\color{red}{1}$ chocolates.
Hence, the total number of chocolates is $\color{red}{24}$ or $\color{red}{23}$. That is:
$$P=20,Z=2,B=2 \ \ \text{or} \ \ P=20,Z=2,B=1$$
in the beginning.
Best Answer
A quick computer check shows that $7272$, $8484$ and $9696$ have the same (maximum) number of divisors ($24$):
{1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72, 101, 202, 303, 404, 606, 808, 909, 1212, 1818, 2424, 3636, 7272},
{1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84, 101, 202, 303, 404, 606, 707, 1212, 1414, 2121, 2828, 4242, 8484},
{1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 96, 101, 202, 303, 404, 606, 808, 1212, 1616, 2424, 3232, 4848, 9696}
so if I understand your question (which of these is minimum?), the answer is: $7272$.
The original question did not state that the solution must be done by hand, but in that case, @MishaLavrov's approach (below) is the best:
Recognize that $abab = ab \cdot 101$, so the factors of $abab$ are maximized when $ab$ has the most factors. It is a simple matter to find (by hand) that $72$, $84$ and $96$ have the same (maximum) number of factors.
The rest is easy.