typedef unsigned short int sh; typedef signed short int ss; typedef unsigned int ui; typedef unsigned char uc; #define S (-1) #include // typedef struct{ui M; ss P; sh L; uc s; uc r; uc pad[0];} packet; // BE typedef struct{uc pad[0]; uc r; uc s; sh L; ss P; ui M;} packet; // LE void nerr(int, packet *); void send(packet *, int); void keep(packet *); void fp(packet * p, int j){ui toll = 3+(p->L>>5); if(toll > p->M) return; p->M -= toll; if(p->r >= p->s) {nerr(1, p); goto e;} int k = p->pad[S*p->r]; if(k>15) {nerr(2, p); goto e;} p->pad[S*(p->r++)] = p->P<0?j:0; if(k) send(p, k); else keep(p); e: ;} int main(){printf("%d\n", (int)sizeof(packet)); return 0;}