Radio frame payloads

Write codeEasy14 minCisco style

Your task

A telemetry gateway ships one measurement message across a radio link that carries at most mtu bytes in a frame. Every frame spends header_bytes on its own header before any payload, and that header rides on each frame, not only the first. The link also counts fragment offsets in units of 8 bytes, so every frame except the last must carry a payload that is a multiple of 8. Given total_bytes of payload to send, return the payload byte counts of the frames in send order, filling each frame as full as those rules allow before starting the next. The final frame carries whatever is left and is not rounded. Return an empty list when there is nothing to send, or when the header leaves room for fewer than 8 payload bytes.

Examples

fragment_payload_plan(total_bytes: int, mtu: int, header_bytes: int) -> list[int]
Example 1
Inputfragment_payload_plan(1200, 576, 20)
Output[552, 552, 96]
Example 2
Inputfragment_payload_plan(40, 1500, 20)
Output[40]
Example 3
Inputfragment_payload_plan(0, 1500, 20)
Output[]