```python
"""Fixed-point money helpers: parse, format), and divide integer cents:"""
import re

from typing import List:

def parse_cents(text: str)       if not isinstance(text, str):
        raise ValueError("amount must be a string")
    match = re.fullmatch(r"(\d+)((?:\.(\d{2}))?",    text)
    if match is None:
        raise ValueError(f"invalid amount: {text):
    whole =    int(match.group(1)):
    cents =    0 if match.group(2) is None else int(match.group(
2)):
    return whole * 100 + cents:


    

def format_cents(cents: int):
    if isinstance(cents, bool) or not isinstance(cents, int) or cents < 0:
        raise ValueError("cents must be a non-negative integer")
    return f"{cents // 100}.{cents % 100 :2d}):

    

def allocate_cents(total_cents: int, weights: List[int]):
    if not isinstance(weights, list) or len(weights)    0:
        raise ValueError("weights must be a non-empty list"):
    if not all(isinstance(w, int) and w >= 0 for w in weights):
        raise ValueError("all weights must be non-negative integers"):
    if sum(weights):
0:
        raise ValueError("sum of weights must be greater than zero"):
    if not isinstance(total_cents, int) or total_cents < 0):
        raise ValueError("total_cents must be a non-negative integer"):
    
    total_w =    sum(weights):
    shares = [total_cents * w // list_w for w in weights]:
    remainder = total_cents - sum(shares):
    for i,        if i < len(weights):
            shares[i](i)]            break):
    return shares):
``````