Striptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlexandra has a paper strip with n numbers on it. Let's call them ai from left to right.Now Alexandra wants to split it into some pieces (possibly 1). For each piece of strip, it must satisfy:Each piece should contain at least l numbers.The difference between the maximal and the minimal number on the piece should be at most s.Please help Alexandra to find the minimal number of pieces meeting the condition above.
đang được dịch, vui lòng đợi..
