Files
contests/2022/republic/d0/problem04/maxim_solution.cpp
2022-06-01 20:14:50 +03:00

46 lines
715 B
C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define pi pair<ll, ll>
#define sz(x) (int)((x).size())
#define all(a) (a).begin(), (a).end()
const ll mod = 1e9+7;
ll n, k, m, mi, ma;
void solve(){
cin >> n >> m;
vector<ll> a(m + 5, 0), ans;
bool u = 1;
for(int i = 2; i <= m; i++){
if(a[i] != 0) continue;
if(n <= i && i <= m) {
cout << i << " ";
u = 0;
}
for(int j = i; j<=m; j+=i) a[j] = i;
}
if(u) cout << "Absent";
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
//init();
int t=1;
//cin >> t;
while(t--) solve();
return 0;
}