| 62 | } |
| 63 | }; |
| 64 | int32_t main() { |
| 65 | ios_base::sync_with_stdio(0); |
| 66 | cin.tie(0); |
| 67 | prec(); |
| 68 | int n; |
| 69 | while (cin >> n) { |
| 70 | string s, p; |
| 71 | cin >> p >> s; |
| 72 | Hashing h(s); |
| 73 | auto hs = Hashing(p).get_hash(); |
| 74 | for(int i = 1; i + n - 1 <= s.size(); i++) { |
| 75 | if (h.get_hash(i, i + n - 1) == hs) cout << i - 1 << '\n'; |
| 76 | } |
| 77 | cout << '\n'; |
| 78 | } |
| 79 | return 0; |
| 80 | } |
| 81 | // https://www.spoj.com/problems/NHAY/ |