#include using namespace std; int power(int A, int B) // you can imagine that A is matrix, but don't forget to write a function to multiply! { if(B == 0) return 1; int x = power(A, B / 2); x *= x; if(B % 2 == 1) x *= A; return x; } int main() { int A, B; cout << power(A, B) << endl; }