#include using namespace std; // Tim so lon nhat int searchMax(int a[], int l, int r) { if (l == r) return a[l]; else { int m = (l + r) / 2; int max1 = searchMax(a, l, m); int max2 = searchMax(a, m + 1, r); if (max1 > max2) return max1; else return max2; } } int main() { int a[8] = {1, 3, 4, 9, 6, 7, 5, 4}; cout << searchMax(a, 0, 7); return 0; }