I - Moving Lights

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

Input

Output

Sample test(s)

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

Notes