⌘K
Flycodx

Canal Water Distribution Balance

Canal Water Distribution Balance

EasyArrays0% accepted

Gujarat irrigation department distributes water from Narmada Canal to 6 villages. Each element in array is allocated water volume (in cubic meters). Verify if allocation is balanced - max difference between any two villages should not exceed 500 m³.

Approach

Given array of water allocations to villages, check if difference between maximum and minimum allocation is within 500 m³ limit.

Input

8 6704 3586 5168 6285 3026 4327 4014 6991

Output

unbalanced
solution.py
Loading editor...
Test 1
Test 2
Test 3

Press Run to test your custom input, or Submit to judge against all test cases.

Sign in to continue

Create a free account to run code, submit solutions and track progress.

  • Free forever — no credit card
  • 10+ languages with live execution
  • Points, streaks & leaderboards
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3