Task task14_graph_money_distribution
# Deterministic Money Distribution on a Directed Graph
You must compute the final money distribution on a directed graph following precise rules.
## Graph Structure
**CONDUCTOR nodes**: C1 through C10
**BENEFICIARY nodes**: B1 through B10 (each Ci has exactly one Bi)
**Directed edges between CONDUCTORs**:
```
C1 --> C2
C2 --> C3
C3 --> C4
C4 --> C2
C4 --> C5
C5 --> C6
C6 --> C7
C7 --> C5
C7 --> C8
C8 --> C9
C9 --> C10
C10 --> C6
```
## Initial Conditions
Solve for **three scenarios**:
1. **Scenario A**: C4 receives **5 cents**. All other nodes start with 0 cents.
2. **Scenario B**: C4 receives **50 cents**. All other nodes start with 0 cents.
3. **Scenario C**: C4 receives **100 cents**. All other nodes start with 0 cents.
## Distribution Rules
When a CONDUCTOR Ci receives N > 0 cents, it distributes ALL N cents in a single step to:
- Its BENEFICIARY Bi
- All CONDUCTORs it has outgoing edges to
**Split Rule**:
1. Divide money equally among all participants
2. Remaining cents (from integer division) are distributed one by one
3. **Tie-break order**: BENEFICIARY first, then CONDUCTORs alphabetically (C1 < C2 < ... < C10)
**Example**: 8 cents split among [B4, C2, C5]:
- 8 / 3 = 2 each, remainder = 2
- Distribution order: B4, C2, C5
- Final: B4=3, C2=3, C5=2
## Recursion
Any CONDUCTOR receiving positive money repeats the same distribution.
BENEFICIARY nodes absorb money and never redistribute.
## Termination
Process ends when no CONDUCTOR holds positive money.
## Your Task
Compute the final amount held by each BENEFICIARY after the process terminates, for all three scenarios.
## Required Output
Create three files:
**`result_5.json`** (for Scenario A - 5 cents):
```json
{
"B1": <cents>,
"B2": <cents>,
"B3": <cents>,
"B4": <cents>,
"B5": <cents>,
"B6": <cents>,
"B7": <cents>,
"B8": <cents>,
"B9": <cents>,
"B10": <cents>
}
```
**`result_50.json`** (for Scenario B - 50 cents):
```json
{
"B1": <cents>,
"B2": <cents>,
"B3": <cents>,
"B4": <cents>,
"B5": <cents>,
"B6": <cents>,
"B7": <cents>,
"B8": <cents>,
"B9": <cents>,
"B10": <cents>
}
```
**`result_100.json`** (for Scenario C - 100 cents):
```json
{
"B1": <cents>,
"B2": <cents>,
"B3": <cents>,
"B4": <cents>,
"B5": <cents>,
"B6": <cents>,
"B7": <cents>,
"B8": <cents>,
"B9": <cents>,
"B10": <cents>
}
```
PS: You are currently working in an automated system and cannot ask any question or have back and forth with a user.
You must compute the final money distribution on a directed graph following precise rules.
## Graph Structure
**CONDUCTOR nodes**: C1 through C10
**BENEFICIARY nodes**: B1 through B10 (each Ci has exactly one Bi)
**Directed edges between CONDUCTORs**:
```
C1 --> C2
C2 --> C3
C3 --> C4
C4 --> C2
C4 --> C5
C5 --> C6
C6 --> C7
C7 --> C5
C7 --> C8
C8 --> C9
C9 --> C10
C10 --> C6
```
## Initial Conditions
Solve for **three scenarios**:
1. **Scenario A**: C4 receives **5 cents**. All other nodes start with 0 cents.
2. **Scenario B**: C4 receives **50 cents**. All other nodes start with 0 cents.
3. **Scenario C**: C4 receives **100 cents**. All other nodes start with 0 cents.
## Distribution Rules
When a CONDUCTOR Ci receives N > 0 cents, it distributes ALL N cents in a single step to:
- Its BENEFICIARY Bi
- All CONDUCTORs it has outgoing edges to
**Split Rule**:
1. Divide money equally among all participants
2. Remaining cents (from integer division) are distributed one by one
3. **Tie-break order**: BENEFICIARY first, then CONDUCTORs alphabetically (C1 < C2 < ... < C10)
**Example**: 8 cents split among [B4, C2, C5]:
- 8 / 3 = 2 each, remainder = 2
- Distribution order: B4, C2, C5
- Final: B4=3, C2=3, C5=2
## Recursion
Any CONDUCTOR receiving positive money repeats the same distribution.
BENEFICIARY nodes absorb money and never redistribute.
## Termination
Process ends when no CONDUCTOR holds positive money.
## Your Task
Compute the final amount held by each BENEFICIARY after the process terminates, for all three scenarios.
## Required Output
Create three files:
**`result_5.json`** (for Scenario A - 5 cents):
```json
{
"B1": <cents>,
"B2": <cents>,
"B3": <cents>,
"B4": <cents>,
"B5": <cents>,
"B6": <cents>,
"B7": <cents>,
"B8": <cents>,
"B9": <cents>,
"B10": <cents>
}
```
**`result_50.json`** (for Scenario B - 50 cents):
```json
{
"B1": <cents>,
"B2": <cents>,
"B3": <cents>,
"B4": <cents>,
"B5": <cents>,
"B6": <cents>,
"B7": <cents>,
"B8": <cents>,
"B9": <cents>,
"B10": <cents>
}
```
**`result_100.json`** (for Scenario C - 100 cents):
```json
{
"B1": <cents>,
"B2": <cents>,
"B3": <cents>,
"B4": <cents>,
"B5": <cents>,
"B6": <cents>,
"B7": <cents>,
"B8": <cents>,
"B9": <cents>,
"B10": <cents>
}
```
PS: You are currently working in an automated system and cannot ask any question or have back and forth with a user.
Results
24
Models Tested
25.0%
Success Rate
2m 37s
Avg Duration
7s - 10m 0s
Duration Range
Details
| Score | Model | Duration | Session (KB) | test_10_correct_distribution_50.sh | test_11_file_exists_100.sh | test_12_valid_json_100.sh | test_13_json_structure_100.sh | test_14_total_money_100.sh | test_15_correct_distribution_100.sh | test_1_file_exists.sh | test_2_valid_json.sh | test_3_json_structure.sh | test_4_total_money.sh | test_5_correct_distribution.sh | test_6_file_exists_50.sh | test_7_valid_json_50.sh | test_8_json_structure_50.sh | test_9_total_money_50.sh |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 100.0% | openrouter/openai/gpt-5 | 3m 0s | 160.5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 100.0% | openrouter/qwen/qwen3-coder | 1m 3s | 79.2 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 100.0% | openrouter/google/gemini-2.5-flash-lite-preview-09-2025 | 43s | 76.5 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 100.0% | openrouter/anthropic/claude-haiku-4.5 | 49s | 71.9 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 100.0% | openrouter/openai/gpt-5.2 | 7m 21s | 374.6 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 100.0% | openrouter/anthropic/claude-sonnet-4.5 | 49s | 49.3 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/google/gemini-3-pro-preview | 6m 45s | 64.3 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/anthropic/claude-opus-4.5 | 1m 2s | 64.2 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/x-ai/grok-3-mini | 1m 34s | 583.2 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/google/gemini-2.5-pro | 5m 55s | 198.3 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/deepseek/deepseek-v3.1-terminus | 1m 30s | 75.1 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/openai/gpt-4.1-nano | 1m 23s | 238.2 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/x-ai/grok-code-fast-1 | 1m 1s | 59.7 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/openai/gpt-5-mini | 1m 19s | 94.9 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 86.7% | openrouter/openai/gpt-4.1-mini | 1m 29s | 143.4 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 60.0% | openrouter/openai/gpt-4o-mini | 1m 43s | 79.7 | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
| 60.0% | litellm/GLM-4.5-Air-FP8-dev | 36s | 78.8 | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
| 0.0% | openrouter/google/gemini-2.5-flash-preview-09-2025 | 22s | 28.9 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 0.0% | litellm/DeepSeek-V3.2-sandbox | 10m 0s | 0.0 | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
| 0.0% | openrouter/openai/gpt-5-nano | 1m 43s | 164.3 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 0.0% | openrouter/openai/gpt-oss-120b | 27s | 82.6 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 0.0% | openrouter/openai/gpt-oss-20b | 7s | 18.6 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 0.0% | openrouter/deepseek/deepseek-chat-v3-0324 | 2m 1s | 186.2 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 0.0% | litellm/GLM-4.6-trtllm-sandbox | 10m 0s | 0.0 | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |