import java.util.Scanner var input = Scanner(System. `in`) fun heightList(nama: Int, testCase: Int): MutableList{ var list: MutableList = mutableListOf(nama) for(i in 1..testCase - 1) list.add( input.nextInt() ) return list } fun result(list: MutableList, nama: Int){ list.sortBy{ it * -1} var listIndex = list.indexOf(nama) + 1 var rank = list.indexOf(nama).toString().split("") var ele = rank[rank.size - 2] if(ele == "0") println("${listIndex}st") else if(ele == "1") println("${listIndex}nd") else if(ele == "2") println("${listIndex}rd") else println("${listIndex}th") } fun main(args: Array){ var nama: Int = input.nextInt() var testCase: Int = input.nextInt() var list: MutableList = heightList(nama, testCase) result(list, nama) }