#include <iostream>

int potencia(int a, int b) {
   if (b == 0) {
      return 1;
   } else if (b % 2 == 0) {
      int t = potencia(a, b / 2);
      return t * t;
   } else if (b % 2 == 1) {
      int t = potencia(a, b / 2);
      return t * t * a;
   }
}

int main( ) {
   std::cout << potencia(2, 10);
}
