#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef long long ll;
typedef pair<int, int> ii;
const ll LINF = (ll)1e18;
const int INF = (int)1e9;
// tham trị
// pass by value
// a trong ham func chi la ban sao cua thang a minh truyen vao
void func(int a) {
a = a + 5;
cout << "a trong ham func = " << a << '\n';
}
// pass by reference
// thao tac truc tiep tren thang a minh truyen vao
void func1(int& a) {
a = a + 5;
cout << "a trong ham func1 = " << a << '\n';
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
// int n;
// cin >> n;
// vector<int> a(n, 0);
// // for (int i = 0; i < n; i++) cin >> a[i];
// // for (int x : a) cin >> x;
// for (int& x : a) cin >> x;
// cout << "vector a ban dau la: \n";
// for (int i = 0; i < n; i++) cout << a[i] << ' '; cout << '\n';
// sort(a.begin(), a.end()) // sap xep tang dan
// cout << "vector a sau khi sap xep: \n";
// for (int x : a) cout << x << ' '; cout << '\n';
// // lower_bound, upper_bound
// auto it = lower_bound(a.begin(), a.end(), 5); // trả về con trỏ chỉ đến phần tử đầu tiên >= 5
// auto it1 = upper_bound(a.begin(), a.end(), 5); // trả về con trỏ chỉ đến phần tử đầu tiên > 5
// int pos = lower_bound(a.begin(), a.end(), 5) - a.begin();
// int pos1 = upper_bound(a.begin(), a.end(), 5) - a.begin();
// cout << pos << ' ' << pos1 << '\n';
// cout << a[pos] << ' ' << a[pos1] << '\n';
// 2 4 5 8 10
// > >
// >
// cout << *it << '\n';
// cout << it1 - a.begin() << '\n';
// for (int x : a) {
// x = x + 5;
// }
// for (auto x : a) { // x la tham tri
// x = x + 5;
// }
// for (auto& x : a) {
// x = x + 5;
// }
// cout << "vector a sau vong for tren: \n";
// for (int i = 0; i < n; i++) cout << a[i] << ' '; cout << '\n';
// reverse(a.begin(), a.end()); // đảo ngược vector a
// cout << "vector a sau khi dao nguoc: \n";
// for (auto& it : a) cout << it << ' '; cout << '\n';
// Hàm sinh hoán vị
// vector<int> c = {2, 1, 3};
// sort(c.begin(), c.end());
// cout << "Tat ca hoan vi cua c la: \n";
// do {
// for (auto& it : c) cout << it << ' '; cout << '\n';
// }
// while (next_permutation(c.begin(), c.end()));
}