#include int main() { int n,k,m,max=0,min=1001,i; scanf("%d%d",&n,&k); for (i=0;im?m:min; } printf("%d\n",max-min); return 0; }