Advertisement
Hasan1026

Untitled

Jul 6th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. unsigned long long w, n, m;
  5.  
  6. int main(){
  7.     ios::sync_with_stdio(0);
  8.     cin.tie(0);
  9.     int t;
  10.     cin>>t;
  11.     for(int i=1; i<=t; i++){
  12.         cin>>w;
  13.         cout<<"Case "<<i<<": ";
  14.         if(w%2) cout<<"Impossible";
  15.         else{
  16.             int j=2;
  17.             while(1){
  18.                 if(w%j==0 && (w/j)%2){
  19.                 cout<<w/j<<' '<<j;
  20.                 break;
  21.                 }
  22.             j+=2;
  23.             }
  24.         }
  25.         cout<<"\n";
  26.     }
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement