• + 0 comments
    book = []
    page = -1
    ans = 0
    
    for i in range(n):
        for j in range(arr[i]):
            if j % k == 0:
                page += 1
                book.append([])
            book[page].append(j+1)
            if page == j:
                ans += 1
    return ans