, and you want to make some problemsets with these problems.In your opinion, the number of problems in one problemset must be in interval. Now you want to know the maximum number of problemsets you can make, where one problem can be used in no more than one problemset.
In xCPC contest, there are totally k_{} k types of problems. Now you have a_i a i problems in type i_{} i , and you want to make some problemsets with these problems. In your opinion, the number of problems in one problemset must be in interval [L, R]_{} [L,R] , and the number of problems in type i_{} i must be in interval [l_i, r_i] [l i ,r i ]. Now you want to know the maximum number of problemsets you can make, where one problem can be used in no more than one problemset.
(图片来源网络,侵删)