-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path1360D.cpp
More file actions
38 lines (35 loc) · 811 Bytes
/
1360D.cpp
File metadata and controls
38 lines (35 loc) · 811 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
#include <cstdio>
#include <vector>
#define DEBUG
#define MAXN 2000000000
#define MULTIPLE(i, j, k) lake[i] * lake[j] * lake[k]
#define ll long long int
#include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef DEBUG
freopen("in.in", "r", stdin);
#endif
ios_base::sync_with_stdio(0);
cin.tie(0);
int t ;
cin >> t ;
while (t--) {
int n, k;
cin >> n >> k;
bool a = true;
int ans = MAXN;
//cout << "=================" << endl;
for (int i = 1; i*i <= n; ++i) {
if (n%i == 0) {
if (n/i <= k) {
ans = min(ans, i);
} else if (i <= k) {
ans = min(ans, n/i);
}
}
}
cout << ans << endl;
}
return 0;
}