n人比赛,可轮空,比赛轮数和场数

时间:2023-03-09 04:25:35
n人比赛,可轮空,比赛轮数和场数
#include<stdio.h>
int chang(int x,int s){
if(x==)
return s;
else if(x==)
return s+;
else if(x%!=){
s+=(x-)/;
return chang((x+)/,s);
}
else{
s+=x/;
return chang(x/,s);
} }
int lun(int x){
if(x==)
return ;
else if(x==)
return ;
else if(x%!=){
return +lun((x+)/);
}
else
return +lun(x/);
}
int main()
{
int K;
scanf("%d", &K);
while(K--)
{
int n;
scanf("%d", &n);
printf("%d %d\n", lun(n),chang(n,));
}
return ;
}