# Volunteer rota (one week of shifts)

Fill a one-week volunteer rota for a small charity or club. You receive the shifts and the volunteers as JSON and return one JSON object. Every rule below is checked by a program.

## Input

```json
{
  "week_starting": "2026-10-19",
  "shifts": [
    {"id": "mon-am", "day": "Mon", "needed": 2},
    {"id": "tue-pm", "day": "Tue", "needed": 1}
  ],
  "volunteers": [
    {"name": "Ana", "available": ["mon-am", "tue-pm"], "max_shifts": 2},
    {"name": "Ben", "available": ["mon-am"], "max_shifts": 1}
  ]
}
```

## Rules (all must hold)

1. Every shift in the input is assigned exactly `needed` different volunteers.
2. A volunteer is only assigned to shifts listed in their own `available`.
3. No volunteer is assigned more than their `max_shifts` across the week.
4. No volunteer works more than one shift on the same day.
5. Use only names from the input, spelled exactly as given.

A valid rota always exists for the input you are given. Work it out carefully before answering; check every rule against your answer.

## Output

Return only this JSON object, no commentary, no code fence. One key per shift id:

```json
{
  "assignments": {
    "mon-am": ["Ana", "Ben"],
    "tue-pm": ["Ana"]
  }
}
```
