H - Dangerous Roads

Languages: C, C++, Java, Python, Kotlin
Time & Memory limits: (details)

Input

Output

Sample test(s)

Input
5 1 2 2 3 4 2 3 5
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
4 6 4 4
--- Showing first 30 lines (click "Copy" to get full content) ---

Notes