#import int n,m,i,j,x,c,d,p=1<<30,a[2000];main(){for(scanf("%d",&n),m=n;n--;i++)scanf("%d",&a[i]);for(;j