fork download
  1. #include<iostream>
  2. #include<cmath>
  3. # define mod 1000000007
  4. using namespace std;
  5. int main(){
  6. int n;
  7. cin>>n;
  8. for(int i=0;i<n;i++){
  9. int a;
  10. cin>>a;
  11. long long unsigned sum=0;
  12. for(int j=1;j<=a;j++){
  13. if(j%2!=0)
  14. sum=sum+int(pow(26,(j/2)+1))%mod;
  15. else
  16. sum=sum+int(pow(26,(j/2)))%mod;
  17.  
  18. }
  19. cout<<sum<<endl;
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 3300KB
stdin
5
1
2
3
4
100
stdout
Standard output is empty