• + 0 comments
    def workbook(n, k, arr):
        book=[]
        ans=0
        for i in range(n):
            for h in range(arr[i]//k):
                book.append(list(range(h*k+1,h*k+k+1)))
            if arr[i]%k!=0:
                book.append(list(range((arr[i]//k)*k+1,arr[i]+1)))
        print(book)
        for d in range(len(book)):
            if d+1 in book[d]:
                ans+=1
        return ans