Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- typedef long long ll;
- using namespace std;
- int main() {
- ll t;
- cin>>t;
- while(t--){
- ll n;
- cin>>n;
- ll suma=0;
- for(ll i=1; i<=n; i++){
- suma+=pow(2,(n-i))*i;
- }
- cout<<(fmod(suma,1e9+7))<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement