fun main( args : Array ) { (1..2).map { readLine()!!.toLong() }.let { val (m, n) = it val b = m/1000L%n val h = n val head = (h downTo h - b + 1).toMutableList() head.add(1) val base = (b downTo 1).toMutableList() base.add(1) ( head.reduce { y,x -> y*x } / base.reduce { y,x -> y*x } ).let { println( it ) } } }