#include <stdio.h>
#include <string.h>
int main(void){
FILE *in;
FILE *out;
unsigned int BLOCK_SIZE = 3;
unsigned int block[BLOCK_SIZE];
in = fopen("input.txt", "rt");
if(in == NULL){ fputs("File error", stderr); return 1; }
out = fopen("output.txt", "wt");
if(out == NULL){ fputs("File error", stderr); return 1; }
while(!feof(in)){
memset(block, 0, sizeof(block)); //Îáíóëÿåì áëîê
int i = 0;
fread(block, sizeof(block), BLOCK_SIZE, in);
//Âûâîäèì áëîê â ôàéë out
fwrite(block, sizeof(block), BLOCK_SIZE, out);
}
fclose(in);
fclose(out);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCgppbnQgbWFpbih2b2lkKXsKICAgIEZJTEUgKmluOwogICAgRklMRSAqb3V0OwogICAgdW5zaWduZWQgaW50IEJMT0NLX1NJWkUgPSAzOwogICAgdW5zaWduZWQgaW50IGJsb2NrW0JMT0NLX1NJWkVdOwogICAgCiAgICBpbiA9IGZvcGVuKCJpbnB1dC50eHQiLCAicnQiKTsKICAgIGlmKGluID09IE5VTEwpeyBmcHV0cygiRmlsZSBlcnJvciIsIHN0ZGVycik7IHJldHVybiAxOyB9CiAgICAKICAgIG91dCA9IGZvcGVuKCJvdXRwdXQudHh0IiwgInd0Iik7CiAgICBpZihvdXQgPT0gTlVMTCl7IGZwdXRzKCJGaWxlIGVycm9yIiwgc3RkZXJyKTsgcmV0dXJuIDE7IH0KICAgIAogICAgd2hpbGUoIWZlb2YoaW4pKXsKICAgICAgICAgICAgICAgICAgICBtZW1zZXQoYmxvY2ssIDAsIHNpemVvZihibG9jaykpOyAgICAgLy/DjsOhw63Ds8Orw7/DpcOsIMOhw6vDrsOqCiAgICAgICAgICAgICAgICAgICAgaW50IGkgPSAwOwogICAgICAgICAgICAgICAgICAgIGZyZWFkKGJsb2NrLCBzaXplb2YoYmxvY2spLCBCTE9DS19TSVpFLCBpbik7CiAgICAgICAgICAgICAgICAgICAgLy/DgsO7w6LDrsOkw6jDrCDDocOrw67DqiDDoiDDtMOgw6nDqyBvdXQKICAgICAgICAgICAgICAgICAgICBmd3JpdGUoYmxvY2ssIHNpemVvZihibG9jayksIEJMT0NLX1NJWkUsIG91dCk7CiAgICB9CiAgICAKICAgIGZjbG9zZShpbik7CiAgICBmY2xvc2Uob3V0KTsKfQ==