#include <stdio.h>
f(x){return(x&~0U/3*2)/2+(x&~0U/3)*2;}
int main (int argc, char **argv) {
int i;
int testcases[] = {0, 1, 9, 85, 220, 1827, 47525};
for (i = 0; i < (sizeof(testcases) / sizeof(testcases[0])); i++) {
printf("f(%d)=%d\n", testcases
[i
], f
(testcases
[i
])); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpmKHgpe3JldHVybih4Jn4wVS8zKjIpLzIrKHgmfjBVLzMpKjI7fQoKaW50IG1haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikgewogICAgaW50IGk7CiAgICBpbnQgdGVzdGNhc2VzW10gPSB7MCwgMSwgOSwgODUsIDIyMCwgMTgyNywgNDc1MjV9OwoKICAgIGZvciAoaSA9IDA7IGkgPCAoc2l6ZW9mKHRlc3RjYXNlcykgLyBzaXplb2YodGVzdGNhc2VzWzBdKSk7IGkrKykgewogICAgICAgIHByaW50ZigiZiglZCk9JWRcbiIsIHRlc3RjYXNlc1tpXSwgZih0ZXN0Y2FzZXNbaV0pKTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==