# Paginate with an Opaque Cursor
Offset pagination (`?page=7`) skips or duplicates rows when data changes
between requests. Cursor pagination (`?cursor=`) stays stable.
### Task
Implement `paginate(ids: list[int], cursor: int | None, limit: int) -> tuple[list[int], int | None]`
returning `(page, next_cursor)` where `page` holds up to `limit` ids strictly
greater than `cursor` (or from the start when `cursor` is `None`), and
`next_cursor` is the last id of the page when more rows remain, else `None`.
### Example
`paginate([1, 2, 3, 4, 5], None, 2)` → `([1, 2], 2)`;
`paginate([1, 2, 3, 4, 5], 2, 2)` → `([3, 4], 4)`;
`paginate([1, 2, 3, 4, 5], 4, 2)` → `([5], None)`.