B - Broken Watch

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

Input

Output

Sample test(s)

Input
2 5 2 5 3
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
300 150
--- Showing first 30 lines (click "Copy" to get full content) ---
Input
3 1578 40 123456 55 9999999 30
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
31560 1234560 599999940
--- Showing first 30 lines (click "Copy" to get full content) ---