Vertical Reading

AtCoder
IDabc360_b
Time2000ms
Memory256MB
Difficulty
You are given two strings $S$ and $T$ consisting of lowercase English letters. Determine if there exists a pair of integers $c$ and $w$ such that $1 \leq c \leq w < |S|$ and the following condition is satisfied. Here, $|S|$ denotes the length of the string $S$. Note that $w$ must be **less than** $|S|$. * If $S$ is split at every $w$ characters from the beginning, the concatenation of the $c$\-th characters of the substrings of length at least $c$ in order equals $T$. ## Constraints * $S$ and $T$ are strings consisting of lowercase English letters. * $1 \leq |T|$ $\leq $ $|S| \leq 100$ ## Input The input is given from Standard Input in the following format: $S$ $T$ [samples]
Samples
Input #1
atcoder toe
Output #1
Yes

If $S$ is split at every two characters, it looks like this:

at
co
de
r

Then, the concatenation of the 2nd characters of the substrings of length at least $2$ is `toe`, which equals $T$. Thus, print `Yes`.
Input #2
beginner r
Output #2
No

$w=|S|$ is not allowed, and no pair of integers $1 \leq c \leq w < |S|$ satisfies the condition. Thus, print `No`.
Input #3
verticalreading agh
Output #3
No
API Response (JSON)
{
  "problem": {
    "name": "Vertical Reading",
    "description": {
      "content": "You are given two strings $S$ and $T$ consisting of lowercase English letters. Determine if there exists a pair of integers $c$ and $w$ such that $1 \\leq c \\leq w < |S|$ and the following condition is",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc360_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given two strings $S$ and $T$ consisting of lowercase English letters.\nDetermine if there exists a pair of integers $c$ and $w$ such that $1 \\leq c \\leq w < |S|$ and the following condition is...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments