#x1035. CF955D Scissors
CF955D Scissors
Scissors
题面翻译
给定两个串,和整数,你可以在中取出任意的两个不相交的串,将它们按顺序拼在一起形成一个新串。
求一种取串的方案使得是新串的子串。 ps:k为两个长度为k的不相交的子串
题目描述
Jenya has recently acquired quite a useful tool — -scissors for cutting strings. They are generally used for cutting out two non-intersecting substrings of length from an arbitrary string (its length should be at least in order to perform this operation) and concatenating them afterwards (preserving the initial order). For example, with the help of -scissors you can cut and out of and concatenate them into , but not and since they're intersecting.
It's a nice idea to test this tool before using it in practice. After looking through the papers, Jenya came up with two strings and . His question is whether it is possible to apply his scissors to string such that the resulting concatenation contains as a substring?
输入格式
The first line contains three integers , , — length of , length of and the aforementioned scissors' parameter correspondingly.
The next two lines feature and consisting of lowercase latin letters.
输出格式
If there is no answer, print «No».
Otherwise print «Yes» and two integers and denoting the indexes where cutted substrings start ( -indexed). If there are several possible answers, output any.
样例 #1
样例输入 #1
7 4 3
baabaab
aaaa
样例输出 #1
Yes
1 5
样例 #2
样例输入 #2
6 3 2
cbcbcb
bcc
样例输出 #2
Yes
2 5
样例 #3
样例输入 #3
7 5 3
aabbaaa
aaaaa
样例输出 #3
No
提示
In the first sample case you can cut out two substrings starting at and . The resulting string baaaab contains aaaa as a substring.
In the second sample case the resulting string is bccb.