```typescript
export function parseAmount(text: string): number {
  if (typeof text !== 'string') throw new Error('Input must be a string');

  const regex = /^\d+(\.\d{2})?$/;
  const match = text.match(regex);

  if (!match) throw new Error('Invalid amount format');

  const integerPart = parseInt(text, 10);
  const decimalPart = parseFloat(text.replace('.', '')) * 100;

  return integerPart + decimalPart;
}

export function formatAmount(cents: number): string {
  if (typeof cents !== 'number' || cents < 0) throw new Error('Input must be a non-negative integer');

  const dollars = Math.floor(cents / 100);
  const centsFloat = cents % 100;

  return `${dollars}.${centsFloat.toString().padStart(2, '0')}`;
}

export function allocateCents(totalCents: number, weights: number[]): number[] {
  if (typeof totalCents !== 'number' || typeof weights !== 'object')
    throw new Error('Inputs must be a non-negative integer and an array of non-negative integers');
  if (!weights.length) throw new Error('Weight list cannot be empty');
  if (!weights.every(Number.isInteger)) throw new Error('Weights must be non-negative integers');
  if (weights.reduce((sum, weight) => sum + weight, 0) === 0)
    throw new Error('Sum of weights cannot be zero');
  if (totalCents < 0) throw new Error('Total cents must be a non-negative integer');

  const shares = [];
  let remainingCents = totalCents;

  for (let i = 0; i < weights.length; i++) {
    if (!Number.isInteger(weights[i])) throw new Error(`Weight at index ${i} must be an integer`);

    const shareSize = Math.floor(remainingCents / weights[i]);
    remainingCents -= shareSize * weights[i];
    shares.push(shareSize);
  }

  // Distribute the leftover cents proportionally by largest remainder
  let remainderIndex = remainingCents;
  for (let i = 0; i < shares.length; i++) {
    if (remainderIndex > 0) {
      const shareRemainder = shares[i] % weights[i];
      if (shareRemainder === remainderIndex) {
        shares[i]++;
        remainderIndex--;
      }
    }
  }

  return shares;
}
```