Sherlock and Square

  • + 1 comment

    Is there any problem with the logic?

    #include <bits/stdc++.h>
    #define MOD 1000000007
    using namespace std; 
    
    int main(){
        int t; 
        cin>>t;
        for(int i=0;i<t;i++){
            long n; 
            cin>>n;
            cout<<2*fmod(1+pow(2,n),MOD)<<"\n";
        }
        return 0;
    }