i;long long m,s,t;main(a,b){for(gets(&b);~scanf("%d%d",&a,&b);t=a+4*b,m=m