#include <stdio.h>
int weight(int a){
int r = 0;
while(a){
a &= (a-1);
++r;
}
return r;
}
int LFSR(){
static unsigned long ShiftRegister = 1;
ShiftRegister = (((((ShiftRegister >> 31)
^(ShiftRegister >> 6)
^(ShiftRegister >> 4)
^(ShiftRegister >> 2)
^(ShiftRegister >> 1)
^ShiftRegister))
& 0x00000001) << 31)
| (ShiftRegister >> 1);
return ShiftRegister & 0x00000001;
}
void main(void){
int a = 7;
int c = weight(a);
int i;
for(i = 0; i < 8; i++)
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgd2VpZ2h0KGludCBhKXsKCWludCByID0gMDsKCXdoaWxlKGEpewoJCWEgJj0gKGEtMSk7CgkJKytyOwoJfQoJcmV0dXJuIHI7Cn0KCmludCBMRlNSKCl7CglzdGF0aWMgdW5zaWduZWQgbG9uZyBTaGlmdFJlZ2lzdGVyID0gMTsKCQoJU2hpZnRSZWdpc3RlciA9ICgoKCgoU2hpZnRSZWdpc3RlciA+PiAzMSkKCQkJCQleKFNoaWZ0UmVnaXN0ZXIgPj4gNikKCQkJCQleKFNoaWZ0UmVnaXN0ZXIgPj4gNCkKCQkJCQleKFNoaWZ0UmVnaXN0ZXIgPj4gMikKCQkJCQleKFNoaWZ0UmVnaXN0ZXIgPj4gMSkKCQkJCQleU2hpZnRSZWdpc3RlcikpCgkJCQkJJiAweDAwMDAwMDAxKSA8PCAzMSkKCQkJCQl8IChTaGlmdFJlZ2lzdGVyID4+IDEpOwoJcmV0dXJuIFNoaWZ0UmVnaXN0ZXIgJiAweDAwMDAwMDAxOwp9Cgp2b2lkIG1haW4odm9pZCl7CglpbnQgYSA9IDc7CglpbnQgYyA9IHdlaWdodChhKTsKCXByaW50ZigiJWRcbiIsIGMpOwoJCglpbnQgaTsKCWZvcihpID0gMDsgaSA8IDg7IGkrKykKCQlwcmludGYoIiVkICIsIExGU1IoKSk7CglzY2FuZigiJWQiLCAmYSk7Cn0=