import org.junit.jupiter.api.Test
import org.junit.platform.commons.annotation.Testable
import kotlin.test.assertEquals

@Testable
class Test {

    @Test
    fun lowerBoundaryTest1() {
        assertEquals(0, solve(splitToNumLongList("3 3 3 3 3")))
    }

    @Test
    fun lowerBoundaryTest2() {
        assertEquals(4, solve(splitToNumLongList("2 1 5 4 3")))
    }

    @Test
    fun lowerBoundaryTest3() {
        assertEquals(0, solve(splitToNumLongList("1 2 3 4")))
    }

    @Test
    fun lowerBoundaryTest4() {
        assertEquals(21, solve(splitToNumLongList("10 2 4 3")))
    }

    @Test
    fun lowerBoundaryTest5() {
        assertEquals(0, solve(splitToNumLongList("1")))
    }

    private fun splitToNumList(mojiretu: String): List<Int> {
        return mojiretu.split(" ").map { it.toInt() }
    }

    private fun splitToNumLongList(mojiretu: String): List<Long> {
        return mojiretu.split(" ").map { it.toLong() }
    }


}
