#include <stdio.h>
int main()
{
int n,k,l,i,a[100000],b[100000],e;
double c,d,max=0,f;
FILE *in,*out;
in = fopen("input.txt", "r");
out = fopen("output.txt", "w");
fscanf(in,"%d",&n);
fscanf(in,"%d",&k);
for(i=0 ; i<k ; i++) {
fscanf(in,"%d %d",&a[i], &b[i]);
}
fscanf(in,"%d",&l);
d=l*2+1;
for(i=0 ; i<k ; i++) {
if(a[i]==a[i+1]) {
if(b[i]>b[i+1]) {
c=a[i]*2-d+b[i]-b[i+1];
}
else if(b[i]<b[i+1]) {
c=a[i]*2-d+b[i+1]-b[i];
}
}
e=l*2+b[k-1]-2;
if(max<c) {
max=c;
}
}
if(max<e) {
max=e;
}
f=max/1;
if(f=!max) {
fprintf(out,"%.1f \n",max);
}
else {
fprintf(out,"%.0f \n",max);
}
fclose(in);
fclose(out);
return 0;
}
ÀÌ°Ô ¿Ö 10Á¡Àΰ¡¿ä...¤Ì¤Ì
¿½ÉÈ÷ Çؼ Ç®¾ú´Âµ¥...