#include <iostream> #include <cstdio> #include <cmath> using namespace std; int main(){ int T,n; cin>>T; for(int i=1; i<=T; i++) { cin>>n; cout<<"Scenario #"<<i<<":"<<endl; cout<<pow(2, n)-(n-2)*pow(2, n-3)-pow(2, n-2)<<endl; if (i!=T) cout<<endl; } return 0; } |
Double click to view unformatted code.