a boy was employed on the understanding that he was to receive 'p' paise for everyday he worked and 'q' paise for everyday when there was no work for him. after 'd' days his earnings amounted to Rs.'x'.how many days had he worked?

If there were w days when he worked, then

x = (pw + q(d-w))/100
100x = pw + qd - qw
w = (100x-qd)/(p-q)