-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
45 lines (44 loc) · 903 Bytes
/
A.cpp
File metadata and controls
45 lines (44 loc) · 903 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
43
44
45
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define Speedo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define return0 return 0
#define Endl endl
#define ull unsigned long long
#define elif else if
#define test cout<<" We Droped up Here Boss_________________"<<endl
#define allout(v) for(auto ele : v){cout<<ele<<" ";}cout<<endl
bool valid(int i ,int j) {
return (i >= 0 and j >= 0);//add the limits later
}
void dfs() {
}
void bfs() {
}
void fastpower() {
}
void dijkstra() {
}
void solve() {
int k;
cin >> k;
//k%m +k%w = 100%w
int a = 100 - k;
for (int i = 2; i < 100; i++) {
while ((k % i == 0) && (a % i == 0)) {
k /= i;
a /= i;
}
}
cout << a + k << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
}