fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
  6.  
  7. #define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
  8. #define debug(x) cerr << "[" << (#x) << "]: " << (x)<<" ";
  9. #define forn(i,a,b) for(int i = (int)(a); i < (int)(b); ++i)
  10. #define all(x) (x).begin(), (x).end()
  11. #define rall(x) (x).rbegin(), (x).rend()
  12. #define mp make_pair
  13. #define mt make_tuple
  14.  
  15. typedef long long ll;
  16. typedef vector<double>vd;
  17. typedef vector<int> vi;
  18. typedef vector<ll> vl;
  19. typedef vector<char> vc;
  20. typedef vector<bool>vb;
  21. typedef pair<int,int>pi;
  22. typedef pair<ll,ll>pl;
  23. typedef tuple<int,int,int>tpi;
  24. typedef tuple<ll,ll,ll>tpl;
  25.  
  26. const int INF=1e9+9;
  27. const int MAXN=1e5+5;
  28. int main() {
  29. fastio;
  30. //freopen("INPUT.TXT", "r", stdin);
  31. //freopen("OUTPUT.TXT", "w", stdout);
  32. int a,b;
  33. cin>>a>>b;
  34. cout<<(min(a,b)+1)/2<<" "<<max(a,b)-(max(a,b)%2==0);
  35. return 0;
  36. }
  37.  
Success #stdin #stdout 0s 4528KB
stdin
3 4 
stdout
2 3