×

# include <iostream>

using namespace std;

# include <cstdlib>

int main() {

int t;
scanf("%d",&t);
while(t--)
{
long long unsigned x=1,z=1,n,i;
scanf("%lld %lld %lld",&x,&z,&n);
for(i=1;i<=(n/2 + n%2);i++)
{
x=x*2;
}
for(i=1;i<=n-(n/2 + n%2);i++)
{
z=z*2;
}
printf("%lld\n",max(x,z)/min(x,z));
}

return 0;


}

2★rawatsir
1
accept rate: 0%

 1 What input are you providing? Floating point exceptions are generally caused by division by zero error, so you might wanna check into that. Edit ---> If the problem is not resolved, link the relevant code and the problem statement. answered 22 Dec '18, 18:55 106●3 accept rate: 13%
 0 Since you haven't provided with the problem code, any solution would be a hypothesis. In my opinion, printf("%lld\n",max(x,z)/min(x,z));  is the culprit. Did you check the constraints on x and z? It probably allows either x or z to be equal to 0. Hence, min(x,z) = 0. And hence it would be a Division by 0 error. Check it out! Also, accept the answer if it helped. answered 22 Dec '18, 19:29 154●8 accept rate: 9%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×2,739
×525
×135
×78
×47
×19
×16
×6

question asked: 22 Dec '18, 18:52

question was seen: 79 times

last updated: 22 Dec '18, 19:29