The code chef compiler is giving wrong answer to this code....but is working fine on my PC :/
http://www.codechef.com/viewsolution/3611816
#include<stdio.h>
int main()
{
int r,i,min=0,max=0,a[10000],b[10000],c[10000];
scanf("%d",&r);
for(i=0;i<r;i++)
{
scanf("%d%d",&a[i],&b[i]);
c[i]=a[i]-b[i];
if(c[i]<min)
min=c[i];
if(c[i]>max)
max=c[i];
}
if(min*-1>max)
printf("2 %d",min*-1);
else
printf("1 %d",max);
return 0;
}