Complete Your Task

Limits 2s, 512 MB

There are NNN girls in a class, having roll numbers from 111 to NNN. Each of them has some points PiP_iPi​ & a task. The task requires PrP_rPr​ points to complete. A girl can use her own points & points from her previous roll girl to complete her task. ( Roll 111 can use her points & points from roll NNN girl.)

This is a companion discussion topic for the original entry at

Solution idea?