// yukicoder: No.716 距離 // 2019.5.2 bal4u #include #if 1 #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) #else #define gc() getchar() #define pc(c) putchar(c) #endif int in() // 整数の入力(負数に対応) { int n = 0, c = gc(); if (c == '-') { c = gc(); do n = 10*n + (c & 0xf), c = gc(); while (c >= '0'); return -n; } do n = 10*n + (c & 0xf), c = gc(); while (c >= '0'); return n; } int main() { int a1, a, p, min, N; N = in(), p = a1 = in(), min = 0x7ffffff; while (--N) { a = in(); if (a - p < min) min = a - p; p = a; } printf("%d\n%d\n", min, a - a1); return 0; }