fork download
  1. /*
  2. " وَكَانَ فَضْلُ اللَّهِ عَلَيْكَ عَظِيمًا "
  3.  
  4. ╔░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╗
  5. ║ ║
  6. ║ ███╗ ███╗ ██████╗ ██╗ ██╗ █████╗ ███╗ ███╗ ███████╗ ██████╗ ║
  7. ║ ████╗ ████║██╔═══██╗██║ ██║ ██╔══██╗ ████╗ ████║ ██╔════╝ ██╔══██╗ ║
  8. ║ ██╔████╔██║██║ ██║███████║ ███████║ ██╔████╔██║ █████╗ ██║ ██║ ║
  9. ║ ██║╚██╔╝██║██║ ██║██╔══██║ ██╔══██║ ██║╚██╔╝██║ ██╔══╝ ██║ ██║ ║
  10. ║ ██║ ╚═╝ ██║╚██████╔╝██║ ██║ ██║ ██║ ██║ ╚═╝ ██║ ███████╗ ██████╔╝ ║
  11. ║ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ║
  12. ║ ║
  13. ║ ██╗ ██╗ ██████╗ ███████╗ ███████╗ █████╗ ███╗ ███╗ ║
  14. ║ ██║ ██║ ██╔═══██╗ ██╔════╝ ██╔════╝ ██╔══██╗ ████╗ ████║ ║
  15. ║ ███████║ ██║ ██║ ███████╗ ███████╗ ███████║ ██╔████╔██║ ║
  16. ║ ██╔══██║ ██║ ██║ ╚════██║ ╚════██║ ██╔══██║ ██║╚██╔╝██║ ║
  17. ║ ██║ ██║ ╚██████╔╝ ███████║ ███████║ ██║ ██║ ██║ ╚═╝ ██║ ║
  18. ║ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ║
  19. ║ ║
  20. ╚░░░░░░░░░░░░░░░░░░░░░░░ MOHAMED HOSSAM | SOFTWARE ENGINEER ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╝
  21. */
  22.  
  23. #include"bits/stdc++.h"
  24. using namespace std;
  25. #define el '\n'
  26. #define ll long long
  27. #define int long long
  28. #define yes cout << "YES\n"
  29. #define no cout << "NO\n"
  30. #define all(x) (x).begin(), (x).end()
  31. #define rall(x) x.rbegin(), x.rend()
  32. #define sz(x) ((int)(x).size())
  33.  
  34. template<class T, class U> T GCD(T a, U b) { return (!b ? a : GCD(b, a % b)); }
  35. template<class T, class U> T LCM(T a, U b) { return ((a / GCD(a, b)) * b); }
  36. template<class Ta, class Tb> bool chmax(Ta &a, Tb b) { if (a >= b) return false; a = b; return true; }
  37. template<class Ta, class Tb> bool chmin(Ta &a, Tb b) { if (a <= b) return false; a = b; return true; }
  38.  
  39. constexpr ll MAX =300000 , MOD = 998244353, MAXN = 2e5 + 10, inf = 1e18;
  40. using vi = vector<int>;
  41. inline void free_palestine() {ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  42.  
  43. #ifndef ONLINE_JUDGE
  44. freopen("inputs.txt", "r", stdin);
  45. freopen("output.txt", "w", stdout);
  46. #endif
  47. }
  48.  
  49. template<typename T>
  50. istream &operator>>(istream &in, vector<T> &v) {
  51. for (auto &x: v) in >> x;
  52. return in;
  53. }
  54. template<typename T>
  55. ostream &operator<<(ostream &out, const vector<T> &v) {
  56. for (const auto &x: v) out << x << ' ';
  57. return out;
  58. }
  59. void solve(int tc) {
  60. int a , b , n ;cin >> a >> b >> n;
  61. n+=2;
  62. vi v(n);
  63. v[0] = a;
  64. v[1] = b;
  65. // 1 2 3 4 5 6
  66. for (int i = 2; i < n; ++i)cin>>v[i];
  67. sort(all(v));
  68. int aa = lower_bound(all(v), a) - v.begin() + 1,
  69. bb = lower_bound(all(v), b) - v.begin() + 1,
  70. ra = v.end() - upper_bound(all(v), a) + 1,
  71. rb = v.end() - upper_bound(all(v), b) + 1;
  72.  
  73. cout<<aa<<" "<<ra<<el<<bb<<" "<<rb;
  74.  
  75. }
  76. int32_t main() {
  77. free_palestine();
  78. // freopen("collectingofficer.in", "r", stdin);// freopen("palindrome.out", "w", stdout);
  79. int tc = 1;
  80.  
  81. //cin >> tc;
  82. for (int i = 1; i <= tc; ++i) {
  83. solve(i);
  84. }
  85.  
  86. /*
  87.   ⢸⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⡷⠀⠀
  88.   ⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠢⣀⠀⠀
  89.   ⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇ Did you get accepted, son?
  90.   ⢸⠀⠀⠀⠀ ⠖⠒⠒⠒⢤⠀⠀⠀⠀⠀⡇⠀⠀
  91.   ⢸⠀⠀⣀⢤⣼⣀⡠⠤⠤⠼⠤⡄⠀⠀⡇⠀
  92.   ⢸⠀⠀⠑⡤⠤⡒⠒⠒⡊⠙⡏⠀⢀⠀⡇⠀
  93.   ⢸⠀⠀⠀⠇⠀⣀⣀⣀⣀⢀⠧⠟⠁ ⡇
  94.   ⢸⠀⠀⠀⠸⣀⠀⠀⠈⢉⠟⠓⠀⠀⠀⢀⡇⠀⠀
  95.   ⢸⠀⠀⠀⠀⠈⢱⡖⠋⠁⠀⠀⠀⠀⠀⡇⠀⡇
  96.   ⢸⠀⠀⠀⠀⣠⢺⠧⢄⣀⠀⠀⣀⣀⠀⡇⠀⡇
  97.   ⢸⠀⠀⠀⣠⠃⢸⠀⠀⠈⠉⡽⠿⠯⡆⡇
  98.   ⢸⠀⠀⣰⠁⠀⢸⠀⠀⠀⠀⠉⠉⠉⠀⡇⠀⡇
  99.   ⢸⠀⠀⠣⠀⠀⢸⢄⠀⠀⠀⠀⠀⠀⠀⡇⠀⡇⠀
  100.   ⢸⠀⠀⠀⠀⠀⢸⠀⢇⠀⠀⠀⠀⠀⠀⡇⠀⡇
  101.   ⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉
  102.   */
  103. }
  104.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
541 2
542 1