https://pintia.cn/problem-sets/994805260223102976/problems/994805265159798784
#include <iostream>
#include <map>
using namespace std;
int main(){
int M, N, S, cnt = 0;
string s[1002];
map<string, int> match;
cin >> M >> N >> S;
getchar();
for(int i = 1; i <= M; i++)
getline(cin, s[i]);
for(int i = S; i <= M; i += N){
while(match[s[i]]) i++;
cnt++;
cout << s[i] << endl;
match[s[i]]++;
}
if(!cnt) cout << "Keep going...";
return 0;
}