| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 7 | 3 | 1 | 25.000% |
You are given $n$ strings $s_1, s_2, \ldots, s_n$. Find any two different indices $x$ and $y$ and a positive integer $k$ such that the string $s_{x}\underbrace{s_{y} s_{y} \ldots s_{y}}_{k\text{ times}}$ is a palindrome with length at most $6 \cdot 10^6$, or report that it is impossible.
The first line contains a single integer $n$ ($2 \le n \le 10^5$).
The next $n$ lines contain $n$ strings $s_1, s_2, \ldots, s_n$, one per line ($1 \leq |s_i| < 10^6$). The strings consist of lowercase English letters. The total length of all strings does not exceed $10^6$.
If there is no answer, output "No" (without quotes).
Otherwise, on the first line, print "Yes" (without quotes). On the second line, print three integers $x$, $y$, and $k$ ($1 \le x,y \le n$, $x \ne y$, $k \ge 1$, $|s_x| + k \cdot |s_y| \le 6 \cdot 10^6$). If there are multiple solutions, print any one of them.
2 aa aa
Yes 1 2 1
4 a bb bcb cdc
No
2 ap papajoj
Yes 2 1 2