https://www.luogu.com.cn/problem/P1308
#include<bits/stdc++.h>
using namespace std;
char s[11],t[1000001],ch;
int n,m,cnt,pos;
int main(){
scanf("%s",s);
n=strlen(s);
scanf("%c",&ch);
while(true){
scanf("%c",&ch);
t[m]=ch;
if(ch=='\n'){
break;
}
m++;
}
for(int i=0;i<n;i++){
if(s[i]>='A'&&s[i]<='Z'){
s[i]=s[i]-'A'+'a';
}
}
for(int i=0;i<m;i++){
if(t[i]>='A'&&t[i]<='Z'){
t[i]=t[i]-'A'+'a';
}
}
pos=-1;
for(int i=0;i<m;i++){
if(i+n-1>=m){
break;
}
bool match=true;
for(int j=0;j<n;j++){
if(t[i+j]!=s[j]){
match=false;
break;
}
}
if(i!=0&&t[i-1]!=' '){
match=false;
}
if(i+n<m&&t[i+n]!=' '){
match=false;
}
if(match){
cnt++;
if(pos==-1){
pos=i;
}
}
}
if(pos==-1){
printf("-1");
}else{
printf("%d %d",cnt,pos);
}
}