#include int main(void){ int i , max, min, N, K, n[11]; max = 0; min = 1000; scanf ( "%d", &N); scanf ( "%d", &K); for ( i = 0; i < N; i++){ scanf ( "%d", n[i]); } for( i = 0; i < N; i++){ if ( max < n[i]) max = n[i]; if (min > n[i]) min = n[i]; } printf("%d\n",max -min); return 0; }