eolymp
bolt
Try our new interface for solving problems
Problems

Палочки

Палочки

Палочки

Time limit 5 seconds
Memory limit 64 MiB
Input example #1
1 8 6 19
Output example #1
54