#include #include #include int main() { int test_cases; std::scanf("%d", &test_cases); char * test_case2 = (char *) malloc(10000000 * sizeof(char)); char * token2 = (char *) malloc(10000000 * sizeof(char)); while (test_cases != 0) { size_t pos = 0; int i = 1; int count = 0; std::vector positions; std::fscanf(stdin, "%s %s", test_case2, token2); std::string test_case = test_case2; std::string token = token2; while ((pos = test_case.find(token)) != std::string::npos) { positions.push_back(pos + i); i += pos + 1; test_case.erase(0, pos + 1); count++; } if (positions.size() == 0) { std::printf("Not Found"); } else { std::printf("%d\n", count); for (size_t pos : positions) { std::printf("%d ", pos); } } std::printf("\n\n"); test_cases--; } return 0; }