MAGCARI

Untitled

Jun 26th, 2021
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int a[100100];
  5. char s[100100];
  6.  
  7. int main()
  8. {
  9.     int c,i,q;
  10.     a[0] = 25,a[1] = 99,a[2] = 223;
  11.     c = 174;
  12.     for(i=3;i<=100000;i++)
  13.     {
  14.         a[i] = (a[i-1] + c)%1000000007;
  15.         c += 50;
  16.     }
  17.     scanf("%d",&q);
  18.     while(q--)
  19.     {
  20.         scanf(" %s",s);
  21.         printf("%d\n",a[strlen(s)-1]);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment