#include #include #include void pos(int x,int y,int b ) { int16_t lr[2]; lr[0]=x; lr[1]=y; lr[0]&=~1; if (!b) lr[1]|=1; fwrite(lr,sizeof(lr),1,stdout); fwrite(lr,sizeof(lr),1,stdout); fwrite(lr,sizeof(lr),1,stdout); } void ana(char *s ) { int16_t lr[2]; int x,y; if (strncmp(s,"PA",2)) return; if (sscanf(s,"PA%d,%d",&x,&y)!=2) return; lr[0]=y*2 - 10000; lr[1]=10000-x*2; lr[0]&=~1; if (x<3000) lr[1]|=1; fwrite(lr,sizeof(lr),1,stdout); } int main(int argc,char *argv[]) { char c; char buf[1024]; int ic,len; buf[0]=0; len=0; while ((ic=getchar())!=EOF) { c=ic; if ((c==';') || (c=='\n') || (c=='\r')) { ana(buf); buf[0]=0; len=0; } else { buf[len++]=c; buf[len]=0; } } ana(buf); return 0; }