solution
#include<iostream>
using namespace std;
int main(){int n, x, top = 1000, down = 0;//管道水平放入==>顶部最低点和底部最高点之间的距离就是能够承担的最大宽度scanf("%d", &n);for(int i = 0; i < n; i++){scanf("%d", &x);if(x < top) top = x;}for(int i = 0; i < n; i++){scanf("%d", &x);if(x > down) down = x;}if(top >= down + 1) printf("Yes %d", top - down);else printf("No %d", down - top + 1);return 0;
}