-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLightOj 1116.cpp
70 lines (53 loc) · 1.4 KB
/
LightOj 1116.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* Which of the favors of your Lord will you deny? */
#include<bits/stdc++.h>
using namespace std;
#define SI(n) scanf("%d",&n)
#define SLL(n) scanf("%lld",&n)
#define SULL(n) scanf("%llu",&n)
#define SC(n) scanf("%c",&n)
#define SD(n) scanf("%lf",&n)
#define fr(i,a,b) for(int i=a ,_b=(b) ;i<= _b;i++)
#define LL long long
#define PUB push_back
#define POB pop_back
#define MP make_pair;
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define GCD __gcd
#define DEBUG cout<<"aw"<<endl;
unsigned LL powa(int x , int y)
{
unsigned LL ans = x;
for(int i=2;i<=y;i++)
{
ans = ans * x;
}
return ans;
}
int main()
{
int tc;
SI(tc);
fr(i,1,tc)
{
unsigned LL w;
int q;
SULL(w);
if(w%2==1)
printf("Case %d: Impossible\n",i);
else
{
unsigned LL q = powa(2,1);
for(int j=1;q<=w;j++ , q = powa(2,j))
{
//DEBUG
if((w/q)%2==1)
{
printf("Case %d: %llu %llu\n",i,(w/q),q);
break;
}
}
}
}
return 0;
}