text
stringlengths
49
983k
#include <bits/stdc++.h> using namespace std; int l, r; int main() { scanf("%d%d", &l, &r); if (l == r) { printf("%d\n", l); } else { printf("2\n"); } }
#include <bits/stdc++.h> using namespace std; int l, r; int main() { cin >> l >> r; cout << ((l == r) ? l : 2); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int l, r; cin >> l >> r; int r2 = l % 2; int r3 = l % 3; int c2 = (r - (l + r2) + 1) / 2 + 1; int c3 = (r - (l + r3) + 1) / 3 + 1; if (l == r) { cout << l; } else if (c3 > c2) { cout << "3"; } else { cout << "2"; } cout << "\n"; return 0; }
#include <bits/stdc++.h> int main() { int l, r; scanf("%d%d", &l, &r); if (l == r) printf("%d\n", r); else printf("2\n"); return 0; }
#include <bits/stdc++.h> using namespace std; int l, r; int main() { scanf("%d%d", &l, &r); if (l == r) printf("%d", l); else puts("2"); return 0; }
#include <bits/stdc++.h> using namespace std; void OJ() {} int solve() { int l, r; cin >> l >> r; if (l == r) cout << l; else cout << 2; return 0; } signed main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ; solve(), cout << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int ebob(int a, int b) { for (;;) { if (a == 0) return b; b %= a; if (b == 0) return a; a %= b; } } int ekok(int a, int b) { int temp = ebob(a, b); return temp ? (a / temp * b) : 0; } int compare(const void* a, const void* b) { return (*(int*)a - *(int*)b); } bool isPrime(int number) { bool isPrime = 1; for (int i = 2; i < number; i++) { if (number % i == 0) isPrime = false; } return isPrime; } int main() { long long int l, r; cin >> l >> r; cout << (l == r) * l + 2 * (l != r); }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) { cout << r << endl; } else if (r > l) { while (1) { if (l % 2 == 0) { cout << "2" << endl; return 0; } else l++; } } }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; int ans = 2; cin >> l >> r; if (l == r && l % 2) { ans = l; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> const double pi = acos(-1.0); using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) { cout << l; return 0; } cout << 2; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; scanf("%d %d", &a, &b); if (a == b) cout << a << endl; else cout << "2" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; while (~scanf("%d%d", &l, &r)) { if (r - l < 3) { if (r - l == 2 && l % 2 == 0) printf("2"); else printf("%d", l); } else printf("2"); printf("\n"); } }
#include <bits/stdc++.h> using namespace std; int main() { int r, l; cin >> r >> l; if (r - l == 0) { cout << r; return 0; } cout << 2; return 0; }
#include <bits/stdc++.h> using namespace std; long long ar[200000]; int ans[200000]; string asl[1000000][2]; string as[1000000]; int main() { int n, i, j, a, b, c, d, e, f, g, l, h, m, maxx, minn, q; string s, t, o, r; char ch, ch1; double p, y, x, u; while (cin >> n >> m) { if (m == n) { cout << n << endl; } else { cout << 2 << endl; } } }
#include <bits/stdc++.h> int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main() { int l, r; scanf("%d %d", &l, &r); printf("%d", l == r ? l : 2); }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) cout << l; else cout << 2; }
#include <bits/stdc++.h> using namespace std; int main() { long l, r; cin >> l >> r; if (l == r) cout << l << endl; else cout << 2 << endl; return 0; }
#include <bits/stdc++.h> int main() { long long l, r; while (~scanf("%lli %lli", &l, &r)) if (l != r || (l == r && l % 2 == 0)) printf("2\n"); else printf("%lli\n", l); }
#include <bits/stdc++.h> int main() { int l, r; scanf("%d %d", &l, &r); printf("%d", l == r ? l : 2); return 0; }
#include <bits/stdc++.h> int main() { long l, r; scanf("%ld %ld", &l, &r); printf("%ld\n", (r <= l + 1) ? l : 2); return 0; }
#include <bits/stdc++.h> int main() { int l, r; while (~scanf("%d %d", &l, &r)) { if (l != r) printf("2\n"); else printf("%d\n", l); } return 0; }
#include <bits/stdc++.h> template <typename T> T Abs(T a) { if (a < 0) return -a; else return a; } using namespace std; int main() { long long int l, r; while (scanf("%lld%lld", &l, &r) != EOF) { if (l != r) cout << '2' << endl; else cout << l << endl; } }
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; int main() { int l, r; cin >> l >> r; if (r > l) cout << 2; else cout << r; }
#include <bits/stdc++.h> int main() { int a, b; while (scanf("%d%d", &a, &b) != EOF) { if (a != b) { printf("2\n"); } else { printf("%d\n", a); } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a != b) cout << 2 << '\n'; else cout << a << '\n'; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int l, r; cin >> l >> r; cout << ((l == r) ? l : 2) << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; int i = x; int j = 2; i = x; int n = 2; int start; int rem; int prev_count = 1; int count = 1; int max_num = n; while (n <= y) { if (y - x == 0) { max_num = x; break; } rem = x % n; if (rem == n) break; if (rem != 0) { start = n - rem + x; j = start; } else j = x; prev_count = count; count = 0; while (j <= y) { count++; j = j + n; } if (prev_count > count) break; else if (count >= prev_count) max_num = n; n = n + 1; } cout << max_num << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (r - l <= 1) cout << l; else { if (l % 3 == 0 && r % 3 == 0 && r - l == 3) cout << 3; else cout << 2; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long s, e; while (cin >> s >> e) { if ((e - s) != 0) cout << 2 << endl; else cout << s << endl; } }
#include <bits/stdc++.h> int main() { long long l, r; scanf("%lld%lld", &l, &r); if (l != r) { printf("2"); } else if (l == r) { printf("%lld", l); } return 0; }
#include <bits/stdc++.h> using namespace std; template <class T> T sqr(T x) { return x * x; } template <class T> T gcd(T a, T b) { return (b != 0 ? gcd<T>(b, a % b) : a); } template <class T> T lcm(T a, T b) { return (a / gcd<T>(a, b) * b); } template <class T> inline T bigmod(T p, T e, T M) { if (e == 0) return 1; if (e % 2 == 0) { long long int t = bigmod(p, e / 2, M); return (T)((t * t) % M); } return (T)((long long int)bigmod(p, e - 1, M) * (long long int)p) % M; } template <class T> inline T bigexp(T p, T e) { if (e == 0) return 1; if (e % 2 == 0) { long long int t = bigexp(p, e / 2); return (T)((t * t)); } return (T)((long long int)bigexp(p, e - 1) * (long long int)p); } template <class T> inline T modinverse(T a, T M) { return bigmod(a, M - 2, M); } int dx4[] = {1, 0, -1, 0}; int dy4[] = {0, 1, 0, -1}; int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}; int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1}; int nx8[] = {1, 1, -1, -1, 2, 2, -2, -2}; int ny8[] = {2, -2, 2, -2, 1, -1, 1, -1}; int month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int l, r; int main() { cin >> l >> r; if (l == r) { cout << l; return 0; } printf("2"); return 0; }
#include <bits/stdc++.h> #pragma GCC optimize("O3") using namespace std; const long double EPS = 0.000000001; const long long INF64 = 1000000000000000000; const long long INF32 = 2000000000; bool iss_pt_in_triangle(pair<long long, long long> a, pair<long long, long long> b, pair<long long, long long> c, pair<long long, long long> point) { long long x1 = a.first, x2 = b.first, x3 = c.first, x0 = point.first; long long y1 = a.second, y2 = b.second, y3 = c.second, y0 = point.second; long long aa = (x1 - x0) * (y2 - y1) - (x2 - x1) * (y1 - y0); long long bb = (x2 - x0) * (y3 - y2) - (x3 - x2) * (y2 - y0); long long cc = (x3 - x0) * (y1 - y3) - (x1 - x3) * (y3 - y0); if (aa == 0 || bb == 0 || cc == 0) return 1; if (aa >= 0 && bb >= 0 && cc >= 0) return 1; if (aa <= 0 && bb <= 0 && cc <= 0) return 1; return 0; } bool iss_ll(long long &__1, long long &__2) { return INF64 / __1 >= __2; } bool iss_sqr(long long &__1) { long long __2 = sqrt((long double)__1); return __2 * __2 == __1; }; bool iss_prime(long long __1) { for (long long i = 2; i * i <= __1; ++i) if (!(__1 % i)) return 0; return 1; } long long gcd(long long __1, long long __2) { while (__1 && __2) if (__1 > __2) __1 = __1 % __2; else __2 = __2 % __1; return __1 + __2; } long long lcm(long long &__1, long long &__2) { return __1 * __2 / (gcd(__1, __2)); } long long MAP[1000]; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long l, r; cin >> l >> r; if (l != r) cout << 2 << "\n"; else cout << l << "\n"; return 0; }
#include <bits/stdc++.h> int main() { int l, r; scanf(" %d%d", &l, &r); if (l == r) printf("%d", l); else printf("2"); }
#include <bits/stdc++.h> using namespace std; int main() { int l, r, j, m, i = 0; scanf("%d%d", &l, &r); if (l % 2 == 0 || l != r) printf("2"); else { m = sqrt(l); for (j = 3; j <= m; j += 2) if (l % j == 0) { printf("%d", j); i = 1; break; } if (i == 0) printf("%d", l); } return 0; }
#include <bits/stdc++.h> using namespace std; int L, R; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> L >> R; if (L == R) cout << L << endl; else cout << 2 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r, two, three; two = three = 0; cin >> l >> r; if (l == r) cout << l; else cout << 2; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) { cout << l << endl; return 0; } else { cout << "2" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; int ans; if (r > l) ans = 2; else if (r == l) ans = l; cout << ans << endl; }
#include <bits/stdc++.h> int main() { int l, r; scanf("%d%d", &l, &r); if (l == r) printf("%d", l); else printf("%d", 2); return 0; }
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; int i, j, k; void solve() { int l, r, x = 0, y = 0; cin >> l >> r; if (l == r) cout << l << "\n"; else cout << 2 << "\n"; } int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); solve(); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; cout << ((l == r) ? l : 2); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, k; cin >> a >> b; if ((b - a) <= 1) k = a; else if ((b - a) == 2 && a % 2 == 1) k = 3; else k = 2; cout << k << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long l, r, ans = 2; cin >> l >> r; if (l == r) ans = l; cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) { cout << l; } else { cout << 2; } return 0; }
#include <bits/stdc++.h> int main() { int l, r, res; scanf("%d %d", &l, &r); if (l == r) printf("%d", l); else printf("2"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int l, r; cin >> l >> r; if (l == r) { if (r % 2 != 0) { cout << r << endl; return 0; } } cout << 2 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long int n, m; cin >> n >> m; if (n == m) { cout << n << "\n"; return 0; } else cout << "2\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; long long n, k, r; cin >> n >> k; if (n == k) cout << n; else cout << 2; cout << "\n"; ; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long int a, s; cin >> a >> s; if (a == s && a % 2 != 0) { cout << a; } else { cout << "2"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if ((b - a) >= 2) cout << "2"; else cout << a; }
#include <bits/stdc++.h> int main() { int l, r; scanf("%d %d", &l, &r); if (l == r) printf("%d", l); else printf("2\n"); return 0; }
#include <bits/stdc++.h> const int INF = 1e9; const int maxn = 260; using namespace std; inline long long read() { char ls; int x = 0, sng = 1; for (; ls < '0' || ls > '9'; ls = getchar()) if (ls == '-') sng = -1; for (; ls >= '0' && ls <= '9'; ls = getchar()) x = x * 10 + ls - '0'; return x * sng; } int main() { int l = read(), r = read(); if (l == r) cout << l; else cout << 2; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) cout << l; else cout << 2; return 0; }
#include <bits/stdc++.h> int main() { int L, R; while (scanf("%d%d", &L, &R) == 2) { int res = 2; if (L == R && L % 2) { res = L; } printf("%d\n", res); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; if (n == l) cout << n; else cout << 2; }
#include <bits/stdc++.h> using namespace std; int main() { long long int i, j; cin >> i >> j; if (i == j) cout << i; else cout << 2; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; scanf("%d%d", &l, &r); if (l == r && l % 2) printf("%d", l); else printf("%d", 2); }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b; cin >> a >> b; if (a == b and a % 2) cout << a << endl; else cout << "2" << endl; }
#include <bits/stdc++.h> using namespace std; long long mx = 0, mn = 1e9 + 7; bool bysec(const pair<char, long long> &a, const pair<char, long long> &b) { return a.second > b.second; } bool strfind(string &st, string &s) { long long m = s.length(), n = st.length(), i, j; for (i = 0; i <= n - m; i++) { for (j = 0; j < m; j++) if (st[i + j] != s[j]) break; if (j == m) return 1; } return 0; } map<char, long long> mp; vector<pair<char, long long> > vt; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long l, r; scanf("%lld", &l), scanf("%lld", &r); if (l == r) return !printf("%lld", l); printf("%s", "2"); }
#include <bits/stdc++.h> using namespace std; int main() { long long int i, l, r; cin >> l >> r; if (l == r) cout << r; else cout << "2"; }
#include <bits/stdc++.h> using namespace std; int main() { int l, s; while (scanf("%d%d", &l, &s) != EOF) { if (l == s) printf("%d\n", l); else printf("2\n"); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while (~scanf("%d%d", &a, &b)) { if (a == b) printf("%d\n", a); else printf("2\n"); } return 0; }
#include <bits/stdc++.h> using namespace std; mt19937_64 rang( chrono::high_resolution_clock::now().time_since_epoch().count()); int rng(int lim) { uniform_int_distribution<int> uid(0, lim - 1); return uid(rang); } long long mpow(long long a, long long b) { long long res = 1; a %= 1000000007; while (b) { if (b & 1) res = res * a % 1000000007; a = a * a % 1000000007; b >>= 1; } return res; } long long nc2(long long x) { return (x * (x - 1)) >> 1; } long long nc3(long long x) { return (nc2(x) * (x - 2)) / 3; } void leftrotate(string &s, int k) { reverse(s.begin(), s.begin() + k); reverse(s.begin() + k, s.end()); reverse(s.begin(), s.end()); } void readarray(long long a[], long long n) { for (long long i = (0); i < (n); ++i) { scanf("%lld", &a[i]); } } void prefill(long long a[], long long n, long long val) { for (long long i = (0); i < (n); ++i) { a[i] = val; } } void solve() { long long a, b; scanf("%lld", &a); scanf("%lld", &b); if (a == b) { cout << a << "\n"; return; } if (a & 1 && a + 2 == b) { cout << a << "\n"; return; } cout << 2 << "\n"; } int main() { auto clk1 = clock(); int t = 1; while (t--) solve(); auto clk2 = clock(); cerr << "Time taken : " << (double)(1.0 * clk2 - clk1) / CLOCKS_PER_SEC << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; const int N = 100010; inline int in() { int x; scanf("%d", &x); return x; } inline long long lin() { long long x; scanf("%I64d", &x); return x; } int main() { int l = in(), r = in(); if (r - l == 0) printf("%d\n", l); else { int ans = 0, mx = 0; for (int i = 2; i <= N; i++) { int tmp = r / i - (l - 1) / i; if (tmp >= mx) { mx = tmp; ans = i; } } printf("%d\n", ans); } }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r && l % 2 != 0) cout << l; else cout << 2; }
#include <bits/stdc++.h> using namespace std; int main() { long long int l, r; cin >> l >> r; if (l == r) cout << l << endl; else cout << 2 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long l, r; cin >> l >> r; if (l == r) cout << l << endl; else cout << 2 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int l, r; cin >> l >> r; if (l == r) cout << l; else cout << 2; return 0; }
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5LL; int vis[5]; int main() { int l, r; cin >> l >> r; if (l == r) cout << l << "\n"; else cout << "2\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long l, r; cin >> l >> r; if (l == r) cout << l; else cout << 2; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; scanf("%d %d", &a, &b); if (a == b) printf("%d", a); else printf("2"); return 0; }
#include <bits/stdc++.h> int l, r; int main() { std::cin >> l >> r; std::cout << (l == r ? l : 2); return 0; }
#include <bits/stdc++.h> using namespace std; int const inf = 1000 * 1000 * 1000; long long const inf64 = 1ll * inf * inf; int const N = 3e5 + 5; int main() { int l, r; cin >> l >> r; if (l == r) { cout << l << "\n"; } else { cout << "2\n"; } return 0; }
#include <bits/stdc++.h> int main() { long int l, r; scanf("%ld %ld", &l, &r); if (l == r) { printf("%ld", l); } else { printf("2 \n"); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long n, m; cin >> n >> m; if (m == n) cout << m << endl; else { cout << 2 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int L, R; cin >> L >> R; L == R ? printf("%lld\n", R) : printf("2\n"); }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r && l & 1) { cout << l << endl; } else { cout << 2 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) return cout << l << endl, 0; if (r == l + 1) return cout << r << endl, 0; int d2 = r / 2 - (l - 1) / 2, d3 = r / 3 - (l - 1) / 3; if (d3 >= d2) return cout << 3 << endl, 0; cout << 2 << endl; }
#include <bits/stdc++.h> using namespace std; int main(void) { int i; int l, r; cin >> l >> r; if (l == r) { cout << r << endl; return 0; } cout << 2 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n, j; cin >> n >> j; if (n % 3 == 0 && j % 3 == 0 && j - n <= 3) cout << 3; else if (n == j) cout << n; else cout << 2; return 0; }
#include <bits/stdc++.h> int main() { int l, r; scanf("%d%d", &l, &r); printf("%d", (l == r ? l : 2)); }
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; if (n == l) cout << n; else cout << 2; return 0; }
#include <bits/stdc++.h> using namespace std; const int inf = 1e9; const int64_t inf64 = 1e18; const double eps = 1e-9; template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << "["; for (const auto &v : vec) { os << v << ","; } os << "]"; return os; } using i64 = int64_t; void solve() { int l, r; cin >> l >> r; if (l == r) cout << l << endl; else cout << 2 << endl; } int main() { std::cin.tie(0); std::ios::sync_with_stdio(false); cout.setf(ios::fixed); cout.precision(10); solve(); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (r - l >= 2) { cout << 2; } else { cout << r; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(); cout.tie(); int n, m; cin >> n >> m; if (n == m) { cout << n << endl; return 0; } cout << 2 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) { cout << l << endl; } else { cout << 2 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int i, j, k, l, r; cin >> l >> r; if (l == r) cout << l; else cout << "2"; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; while (cin >> a >> b) { if (a == b) cout << a << endl; else if (a % 3 == 0 && b == a + 3) cout << 3 << endl; else cout << 2 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; long long l, r; int main() { while (cin >> l >> r) { if (l == r) { cout << l << endl; } else { cout << 2 << endl; } } return 0; }
#include <bits/stdc++.h> using namespace std; int na2(int x, int m) { int s = 0; for (int i = x; i < m + 1; i++) { if (i % 2 == 0) { s++; }; } return s; } int na3(int x, int m) { int s = 0; for (int i = x; i < m + 1; i++) { if (i % 3 == 0) { s++; } } return s; } int main() { long long r, l, s = 0; cin >> l >> r; int i = l; if (l == r) cout << l; else { if (r - l > 10) cout << '2'; else { (na2(l, r) > na3(l, r)) ? cout << '2' : cout << '3'; } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; scanf("%d %d", &l, &r); if (l == r) printf("%d\n", l); else printf("2\n"); return 0; }
#include <bits/stdc++.h> using namespace std; int l, r; int main() { scanf("%d%d", &l, &r); printf("%d\n", l == r ? l : 2); return 0; }
#include <bits/stdc++.h> using namespace std; const long long INF = 1 << 30; const long long N = 1e6; #pragma GCC optimize("O1") #pragma GCC optimize("O2") #pragma GCC optimize("O3") #pragma GCC optimize("O4") #pragma GCC optimize("O5") #pragma GCC optimize("O6") #pragma GCC optimize("O7") #pragma GCC optimize("O8") #pragma GCC optimize("Ofast") #pragma GCC target("avx2") long long n, fib[N]; map<long long, long long> m; int main() { std::ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long l, r; cin >> l >> r; if (l == r) cout << l; else cout << 2; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long l, r; cin >> l >> r; if (l - r == 0) cout << l; else if (l - r == 3) { if (l % 3 == 0) cout << "3"; else cout << "2"; } else cout << "2"; }
#include <bits/stdc++.h> using namespace std; const long long inf = (long long)(2e18); const long double eps = 1e-6; const unsigned long long infu = (unsigned long long)(1e36); const long double pi = 3.141592653589793; long long power(long long a, long long k) { if (k == 0) return 1; if (k % 2) return power(a, k - 1) * a; long long x = power(a, k / 2); return x * x; } vector<long long> pFunc(string s) { long long n = s.length(); vector<long long> p(n, 0); for (long long i = 1; i < n; i++) { long long j = p[i - 1]; while (j && (s[i] != s[j])) j = p[j - 1]; if (s[i] == s[j]) j++; p[i] = j; } return p; } vector<long long> pFunc(string s1, string s2) { return pFunc(s2 + '$' + s1); } long long gcd(long long a, long long b) { while (a && b) { a %= b; swap(a, b); } return a + b; } long long lcm(long long a, long long b) { return a * b / gcd(a, b); } signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long l, r; cin >> l >> r; if (r - l <= 1000) { map<long long, long long> cnt; for (long long i = l; i <= r; i++) { for (long long j = 2; j * j <= i; j++) { if (i % j == 0) { cnt[j]++; if (j * j != i) cnt[i / j]++; } } cnt[i]++; } long long mx = 1; for (auto i : cnt) { if (cnt[mx] < i.second) mx = i.first; } cout << mx << endl; } else cout << "2\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; cin >> l >> r; if (l == r) cout << l << endl; else cout << 2 << endl; }
#include <bits/stdc++.h> using namespace std; bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) { return a.first > b.first; } int main() { ios::sync_with_stdio(false); cin.tie(0); ; int l, r; while (cin >> l >> r) { if (l == r) { int lim = sqrt(l); bool b = false; for (int i = 2; i <= lim; i++) if (l % i == 0) { cout << i << endl; b = true; break; } if (!b) cout << l << endl; } else cout << 2 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int l, r; cin >> l >> r; (l == r) ? cout << l : cout << 2; }
#include <bits/stdc++.h> using namespace std; template <typename T, typename V> inline void mn(T &x, V y) { if (y < x) x = y; } template <typename T, typename V> inline void mx(T &x, V y) { if (x < y) x = y; } int main() { ios::sync_with_stdio(false); cin.tie(0); int a, b; cin >> a >> b; if (a == b) cout << a; else cout << 2; cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int l, r; int ans = 0; scanf("%d%d", &l, &r); if (l == r) { printf("%d\n", l); } else { printf("2\n"); } return 0; }