#include
Int main ()
{
__int64 digui (int x, int y, int z);
int x,y,z;
__int64 luoshou shundao;
While (the scanf (" % d % d % d ", & amp; X, & amp; Y, & amp; Z)!=(EOF)
{
Shundao=digui (x, y, z);
Luoshou=1 + x (x) * (z - 1 + (z) * (y - 1));
Printf (" % % LLD LLD \ n ", luoshou, shundao);
}
return 0;
}
__int64 digui (int x, int y, int z)
{
If (x % 2==0)
{
Return digui (/2 x, y, z) + 1;
}
Else if (x % 2!=0 & amp; & Y % 2==0)
{
Return digui (x, y/2, z) + 1;
}
Else if (x % 2!=0 & amp; & Y % 2!=0 & amp; & Z % 2==0)
{
Return 1 + digui (x, y, z/2);
}
The else
{
If (x!
=1){
Return 1 + digui (1 x, y, z);
}
Else if (x==1 & amp; & y!
=1){
Return 1 + digui (x, y - 1, z);
}
Else if (x==1 & amp; & Y==1 & amp; & Z!
=1){
Return 1 + digui (x, y, z - 1);
}
The else
{
return 0;
}
}
}
CodePudding user response:
Haven't said what's the problem