CF1413C Perform Easily

Description

After battling Shikamaru, Tayuya decided that her flute is too predictable, and replaced it with a guitar. The guitar has $ 6 $ strings and an infinite number of frets numbered from $ 1 $ . Fretting the fret number $ j $ on the $ i $ -th string produces the note $ a_{i} + j $ . Tayuya wants to play a melody of $ n $ notes. Each note can be played on different string-fret combination. The easiness of performance depends on the difference between the maximal and the minimal indices of used frets. The less this difference is, the easier it is to perform the technique. Please determine the minimal possible difference. For example, if $ a = [1, 1, 2, 2, 3, 3] $ , and the sequence of notes is $ 4, 11, 11, 12, 12, 13, 13 $ (corresponding to the second example), we can play the first note on the first string, and all the other notes on the sixth string. Then the maximal fret will be $ 10 $ , the minimal one will be $ 3 $ , and the answer is $ 10 - 3 = 7 $ , as shown on the picture. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1413C/75869e5e3f35cb76d96c1bbe62cb5730522c5a69.png)

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first sample test it is optimal to play the first note on the first string, the second note on the second string, the third note on the sixth string, the fourth note on the fourth string, the fifth note on the fifth string, and the sixth note on the third string. In this case the $ 100 $ -th fret is used each time, so the difference is $ 100 - 100 = 0 $ . ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1413C/4a9f5f121daaf96225841a762483d6d36c81ea82.png)In the second test it's optimal, for example, to play the second note on the first string, and all the other notes on the sixth string. Then the maximal fret will be $ 10 $ , the minimal one will be $ 3 $ , and the answer is $ 10 - 3 = 7 $ . ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1413C/d3f532a5b4af047547fabc1dd582c7d88c33efa7.png)