```python
def parse_amount(text: str) -> int:
    if not isinstance(text, str):
        raise ValueError("Input must be a string")
    if text.isdigit() or (text.count('.') == 1 and text.replace('.', '', 1).isdigit()):
        integer_part, _, fraction_part = text.partition('.')
        return int(integer_part) * 100 + int(fraction_part or '0')
    else:
        raise ValueError("Invalid amount format")

def format_amount(cents: int) -> str:
    if not isinstance(cents, int) or cents < 0:
        raise ValueError("Invalid cents value")
    return f"{cents // 100}.{cents % 100:02d}"

def allocate_cents(total_cents: int, weights: list) -> list:
    if not weights or any(not isinstance(w, int) or w < 0 for w in weights):
        raise ValueError("Weights must be non-negative integers")
    if sum(weights) == 0:
        raise ValueError("Sum of weights must be greater than zero")
    if total_cents < 0:
        raise ValueError("Total cents must be a non-negative integer")

    base_shares = [total_cents * w // sum(weights) for w in weights]
    remainder = total_cents - sum(base_shares)
    extra = sorted(range(len(weights)), key=lambda i: (weights[i], -i))[:remainder]
    result = [base_shares[i] + 1 if i in extra else base_shares[i] for i in range(len(weights))]
    return result
```