{"problem":{"name":"I prefer ISCT","description":{"content":"You are given a string $S, T$ of length $N$ consisting of only uppercase English letters. You can perform the following operation $0$ or more times: *   If there exists a substring of $S$ such that `","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"ttpc2024_2_f"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S, T$ of length $N$ consisting of only uppercase English letters. You can perform the following operation $0$ or more times:\n\n*   If there exists a substring of $S$ such that `TIOT`, choose one and replace it with `ISCT`. (More precisely, if there exists $1 \\le i \\le N-3$ such that $S_{i}={}$`T`, $S_{i+1}={}$`I`, $S_{i+2}={}$`O`, $S_{i+3}={}$`T`, choose one and replace it with $S_{i}={}$`I`, $S_{i+1}={}$`S`, $S_{i+2}={}$`C`, $S_{i+3}={}$`T`.)\n\nCan you make $S$ equal to $T$ by performing the operation?\nYou have $Q$ test cases to answer.\n\n## Constraints\n\n*   $1 \\leq Q \\leq 5 \\times 10^4$\n*   $4 \\le N \\le 2 \\times 10^5$\n*   $S$ and $T$ are strings of length $N$ consisting of uppercase English letters.\n*   The sum of $N$ across the test cases is at most $2 \\times 10^5$.\n\n## Input\n\nThe input is given in the following format:\n\n$Q$\n${case}_1$\n${case}_2$\n$\\vdots$\n${case}_Q$\n\nEach test cases is given in the following format:\n\n$N$\n$S$\n$T$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"ttpc2024_2_f","tags":[],"sample_group":[["3\n10\nETIOTROPIC\nEISCTROPIC\n6\nBTIEOT\nBISECT\n10\nTIOTIOTIOT\nTIOISCISCT","Yes\nNo\nYes\n\nFor the first test case, you can match `ETIOTROPIC` to `EISCTROPIC` by performing the operation once as follows:\n\n*   The substring from the $2$ nd to $5$ th characters in `ETIOTROPIC` is `TIOT`, so replace it with `ISCT`.\n\nFor the second test case, you cannot match two strings through the operation."]],"created_at":"2026-03-03 11:01:14"}}