fun main() = runBlocking {
    println("main starts")
    joinAll(
        async { coroutine(1, 500L) },
        async { coroutine(2, 300L) }
    )
    println("main ends")
}

private suspend fun coroutine(number: Int, t: Long) {
    println("Routine $number starts to work")
    delay(t)
    println("Routine $number finished")
}