Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int a[100100];
- char s[100100];
- int main()
- {
- int c,i,q;
- a[0] = 25,a[1] = 99,a[2] = 223;
- c = 174;
- for(i=3;i<=100000;i++)
- {
- a[i] = (a[i-1] + c)%1000000007;
- c += 50;
- }
- scanf("%d",&q);
- while(q--)
- {
- scanf(" %s",s);
- printf("%d\n",a[strlen(s)-1]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment