主要完成统计1的个数
#include <stdio.h>
int oneNum(int n){
int res = 0;
while(n){
n=n&(n-1);
res++;
}
return res;
}
int main(){
int l,r,m;
while(~scanf("%d %d %d",&l,&r,&m)){
int ans = 0;
for(int i = l ; i <= r; i++){
if(oneNum(i) == m) ans++;
}
if(ans!=0) printf("%d\n",ans);
else printf("-1\n");
}
return 0;
}