-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1091.cpp
More file actions
43 lines (41 loc) · 742 Bytes
/
1091.cpp
File metadata and controls
43 lines (41 loc) · 742 Bytes
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
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
int main(){
int t;
cin>>t;
while(t--){
ll n;
cin>>n;
ll ba=1;
ll tt=n;
while(tt){
ba*=10;
tt/=10;
}
int flag=0;
for(ll k=1;k<10;k++){
if((n*n*k)%ba==n){
cout<<k<<" "<<n*n*k<<endl;
flag=1;
break;
}
}
if(!flag){
cout<<"No"<<endl;
}
}
return 0;
}