#include <stdio.h>
int main( void )
{
unsigned int m, n, q, r, i;
q=0;
r=0;
i=8*sizeof(unsigned int);
do {
i--;
r<<=1;
r |= (0x01 & (m>>i));
if(r>=n) {
r-=n;
q|= 0x01 << i;
}
} while(i!=0);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBtYWluKCB2b2lkICkKewogICAgdW5zaWduZWQgaW50IG0sIG4sIHEsIHIsIGk7CglwcmludGYoIm3Dt25cbiIpOwoJcHJpbnRmKCJtID0gIik7c2NhbmYoIiVkIiwgJm0pOwoJcHJpbnRmKCJuID0gIik7c2NhbmYoIiVkIiwgJm4pOwoJCglxPTA7CglyPTA7CglpPTgqc2l6ZW9mKHVuc2lnbmVkIGludCk7CglkbyAgewoJCWktLTsKCQlyPDw9MTsKCQlyIHw9ICgweDAxICYgKG0+PmkpKTsKCQlpZihyPj1uKSB7CgkJCXItPW47CgkJCXF8PSAweDAxIDw8IGk7CgkJfQoJfSB3aGlsZShpIT0wKTsKCglwcmludGYoIuWVhuOBryVkXG4iLCBxKTsKCXJldHVybiAwOwp9Cg==