← 返回 google 的题目列表Chunking with an Unsplittable Header
类型:online_judge
Problem: Chunking with an Unsplittable Header
You need to transmit data bytes plus an unsplittable header of size header.
Rules:
header cannot be split across chunks.
Each chunk size must be <= maxChunkSize.
header may occupy a chunk by itself.
data may be split arbitrarily.
Goal: minimize the number of chunks; return any optimal split.
Example: header=600, data=300, maxChunkSize=700 => [600,300].
If header > maxChunkSize, transmission is impossible.
Example
Input
header=600 data=300 maxChunkSize=700
Output
600 300 OR 700 200 (depending on interpretation; recommended: 700 200)