http://acm.hdu.edu.cn/showproblem.php?pid=5944
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
string s;
cin >> s;
int cnt = 0;
for (int i = 2; i * i <= s.size(); i++)
{
for (int j = 1; j * i * i <= s.size(); j++)
{
if ((s[j - 1] == 'y' && s[ j * i - 1] == 'r' && s[j * i * i - 1] == 'x') || (s[j - 1] == 'x' && s[ j * i - 1] == 'r' && s[j * i * i - 1] == 'y'))
{
cnt++;
}
}
}
cout << cnt << endl;
}
return 0;
}