| ||||||||||
Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
Sequence Partitioning
Description Given a sequence of N ordered pairs of positive integers (Ai, Bi), you have to partition it into several contiguous parts. Let p be the number of these parts, whose boundaries are (l1, r1), (l2, r2), ... ,(lp, rp), which satisfy li = ri − 1 + 1, li ¡Ü ri, l1 = 1, rp = n. The parts themselves also satisfy the following restrictions:
Let Si be the sum of B-components of elements in the ith part. Now I want to minimize the value max{Si:1 ¡Ü i ¡Ü p} Could you tell me the minimum? Input The input contains exactly one test case. The first line of input contains two positive integers N (N ¡Ü 50000), Limit (Limit ¡Ü 231-1). Then follow N lines each contains a positive integers pair (A, B). It's always guaranteed that Output Sample Input Sample Output Hint Source |
[Submit] [Go Back] [Status] [Discuss]
All Rights Reserved 2003-2006 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator