-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1116 - Ekka Dokka.cpp
68 lines (61 loc) · 1.23 KB
/
1116 - Ekka Dokka.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
/**
* Author: Ashraful Islam Rafi
* University: Leading University,Sylhet
* url: http://www.lightoj.com/volume_showproblem.php?problem=1116
* problem id: 1116 - Ekka Dokka
* complexity: 1st level(Number theory)
* site: Lightoj.com
**/
#include"map"
#include"set"
#include"queue"
#include"cmath"
#include"stack"
#include"ctype.h"
#include"cstdio"
#include"vector"
#include"cstdio"
#include"cstring"
#include"cstdlib"
#include"string.h"
#include"iostream"
#include"algorithm"
using namespace std;
#define cs "Case "<<++casee<<": "
#define csE "Case "<<++casee<<":\n"
#define sf(t) scanf("%d",&t)
#define sNE(n,e) scanf("%d %d",&N,&E)
#define Inf 1000000000
#define S_N 5000010
#define size_N 10000000
#define MST(a, tf) memset(a, tf, sizeof (a))
int main()
{
int t;sf(t);long long ans=0;long long casee=0;long long x=0;
while(t--)
{
long long n;cin>>n;ans=0;
cout<<cs;
if(n % 2 !=0) printf("Impossible\n");
else
{
x=1;
while(n%2==0)
{
// clog<<n<<endl;
n = n/2; x= x*2;
}
cout<<n<<" "<< x<<endl;
}
}
}
///--test casee--///
/**
3
10
5
12
Case 1: 5 2
Case 2: Impossible
Case 3: 3 4
**/