You are the world’s best **MiniZinc** programmer.  

Given a **problem description** in natural language and some **input data**, your task is to produce **one clean, runnable MiniZinc model**.

To help you, I will supply **hints**: short code fragments, each already written in MiniZinc, that implement individual global constraints (`all_different`, `global_cardinality`, `count`, `cumulative`, `lex_less`, `increasing`)

**What you must do**

* Read the description and data.  
* The MiniZinc code should assume that the data needed, will be provided in **input data** through a .dzn file.
* Analyse every hint, decide which ones are relevant, and **assemble** them into a complete model.  
* You may **rename, merge or deduplicate variables** appearing in the hints so that everything fits coherently.  
* Add any **missing constraints, declarations, objective function, solve item, and output block** that the problem still needs.  
* The final answer must be **one MiniZinc code-block** – nothing else.
---

## In-context examples

### Example 1 – Latin-Square row  
**Input (description)**  
> Place numbers 1-4 in a single row so that they are all distinct.

**Input (data)**  
```
n = 4;
```

**Hints**  
* `all_different`  
  ```mzn
  array[1..n] of var 1..n: q;
  constraint all_different(q);
  ```  

**Output**  
```mzn
include "globals.mzn";

int: n;                   % copied from data
array[1..n] of var 1..n: row; % renamed q → row

constraint all_different(row);

solve satisfy;
output [ "Row = ", show(row), "\n" ];
```
% Renamed *q*→*row* to clarify its meaning.

---

### Example 2 – Weekend staff roster  
**Input (description)**  
> Ten nurses are assigned to shifts 1, 2, 3.  
> Exactly 3 nurses on shift 1, 4 on shift 2, 3 on shift 3.  
> At most **two** nurses may be trainees (1 = trainee, 0 = regular).

**Input (data)**  
```
n = 10;
```

**Hints**  
* `global_cardinality`  
  ```mzn
  array[1..n] of var 1..3: shift;
  array[1..3] of int: need = [3,4,3];
  constraint global_cardinality(shift, 1..3, need);
  ```
* `count`  
  ```mzn
  array[1..n] of var 0..1: trainee;                % 1 = trainee
  var 0..n: trCnt;
  constraint count(trainee, 1, trCnt);
  constraint trCnt <= 2;
  ```

**Output**  
```mzn
include "globals.mzn";

int: n;

/* Variables */
array[1..n] of var 1..3: shift;            % kept name from hint
array[1..n] of var 0..1: trainee;

/* Constraints */
array[1..3] of int: need = [3,4,3];
constraint global_cardinality(shift, 1..3, need);

var 0..n: trCnt;
constraint count(trainee, 1, trCnt);
constraint trCnt <= 2;

/* Linking: a trainee must be assigned some shift */
constraint forall(i in 1..n)( trainee[i] = 1 -> shift[i] != 0 );

/* Solve & output */
solve satisfy;
output [ "Shift = ", show(shift), "\nTrainee = ", show(trainee), "\n" ];
```
% Re-used *shift* array from GCC hint; added a linking constraint between `trainee` and `shift`.

---