You most likely have seen the Russian Dolls which stack inside each other.
Each doll has a different weight and storage ability.
Your task is to nest as many dolls as possible.
Standard input consists of several lines, each containing a pair of integers
separated by one or more space characters, specifying the weight and
of a doll.
The weight of the doll is in grams.
The storage ability, also in grams, is the doll's overall storage capacity,
including its own weight.
That is, a doll weighing 400g with a strength of 900g could carry 500g of
dolls inside it.
There are at most 6000 dolls. The maximum weight of any doll
is 100000g and the maximum storage capacity is 20000000g.
Each case ends up with double 0 and it should not be treated as a doll.
Your output is a single integer indicating the maximum number of dolls
that can be nested without exceeding the storage ability of any one.
Output for Sample Input