Module Expr Str Assign NameStore Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Assign NameStore Num Assign NameStore Num For NameStore NameLoad body AugAssignAdd NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad BinOpSub NameLoad SubscriptLoad NameLoad Index Num Return NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Import alias Assign NameStore Call NameLoad Str Str Assign NameStore Call NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Lambda arguments args NameParam defaults Call NameLoad NameLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr attr Str Assign NameStore BinOpMod Str Call AttributeLoad Call NameLoad attr NameLoad Print NameLoad
N/A N/A 
You have a long list of tasks that you need to do today. To accomplish task i, you need Mi minutes and the deadline for
this task is Di. You need not complete a task at a stretch. You can complete a part of it, switch to another task, and
then switch back.

You've realized that it might not be possible to complete all the tasks by their deadline. So you decide to do them in
such a manner that the maximum amount by which a task's completion time overshoots its deadline is minimized.

Input:
The first line contains the number of tasks T. Each of the next T lines contains two integers Di and Mi.
 N/A __author__ Danyang Solution N/A object N/A solve N/A N/A self cipher N/A N/A N/A 
        Small test cases pass. Sort by deadline and complete them one by one

        for complete solution: https://github.com/ningke/tasksched

        main solution function
        :param cipher: the cipher
         N/A tasks cipher N/A N/A N/A tasks sort key N/A N/A N/A t N/A N/A t N/A 0 N/A overshot -1 N/A timer 0 N/A task tasks N/A N/A timer N/A task N/A 1 N/A overshot N/A max overshot N/A timer N/A task N/A 0 N/A overshot N/A N/A N/A N/A __name__ __main__ N/A N/A sys N/A f N/A open 1.in r N/A testcases N/A int N/A N/A N/A N/A f readline strip N/A cipher N/A N/A t N/A xrange testcases N/A N/A N/A N/A cipher append N/A map N/A N/A N/A x N/A N/A int x N/A N/A N/A N/A N/A N/A f readline strip split N/A s N/A %s
 N/A N/A N/A Solution solve cipher N/A s