Nick takes an important test soon. The test has n variants, and variant i has tasks numbered from 1 to mi. For every task of every variant Nick has written down the time tij in minutes that he needs to solve it.
The tasks must be solved in the order they appear in the variant, one after another. The answers must be submitted within the deadline of t minutes. Nick thinks about secretly copying a solution from his notes, but he does not want to risk much, so he copies at most one solution. A task whose solution he copies costs t0 minutes instead of its own time.
For each variant, find the largest number of tasks Nick can write down if he gets that variant.