#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main(){ int T,n; cin>>T; while (T--) { cin>>n; cout<<pow(2, n)-(n-2)*pow(2, n-3)-pow(2, n-2)<<endl; } return 0; }
Double click to view unformatted code.