{"raw_statement":[{"iden":"problem statement","content":"In some other world, today is Christmas Eve.\nThere are $N$ trees planted in Mr. Takaha's garden. The height of the $i$\\-th tree $(1 \\leq i \\leq N)$ is $h_i$ meters.\nHe decides to choose $K$ trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\nMore specifically, let the height of the tallest decorated tree be $h_{max}$ meters, and the height of the shortest decorated tree be $h_{min}$ meters. The smaller the value $h_{max} - h_{min}$ is, the better. What is the minimum possible value of $h_{max} - h_{min}$?"},{"iden":"constraints","content":"*   $2 \\leq K < N \\leq 10^5$\n*   $1 \\leq h_i \\leq 10^9$\n*   $h_i$ is an integer."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$\n$h_1$\n$h_2$\n$:$\n$h_N$"},{"iden":"sample input 1","content":"5 3\n10\n15\n11\n14\n12"},{"iden":"sample output 1","content":"2\n\nIf we decorate the first, third and fifth trees, $h_{max} = 12, h_{min} = 10$ so $h_{max} - h_{min} = 2$. This is optimal."},{"iden":"sample input 2","content":"5 3\n5\n7\n5\n7\n7"},{"iden":"sample output 2","content":"0\n\nIf we decorate the second, fourth and fifth trees, $h_{max} = 7, h_{min} = 7$ so $h_{max} - h_{min} = 0$. This is optimal.\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here)."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}