CF955D.Scissors

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Jenya has recently acquired quite a useful tool — kk -scissors for cutting strings. They are generally used for cutting out two non-intersecting substrings of length kk from an arbitrary string ss (its length should be at least 2k2·k in order to perform this operation) and concatenating them afterwards (preserving the initial order). For example, with the help of 22 -scissors you can cut abab and dede out of abcdeabcde and concatenate them into abdeabde , but not abab and bcbc 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 ss and tt . His question is whether it is possible to apply his scissors to string ss such that the resulting concatenation contains tt as a substring?

输入格式

The first line contains three integers nn , mm , kk (2<=m<=2k<=n<=5105)(2<=m<=2·k<=n<=5·10^{5}) — length of ss , length of tt and the aforementioned scissors' parameter correspondingly.

The next two lines feature ss and tt consisting of lowercase latin letters.

输出格式

If there is no answer, print «No».

Otherwise print «Yes» and two integers LL and RR denoting the indexes where cutted substrings start ( 11 -indexed). If there are several possible answers, output any.

输入输出样例

  • 输入#1

    7 4 3
    baabaab
    aaaa
    

    输出#1

    Yes
    1 5
    
  • 输入#2

    6 3 2
    cbcbcb
    bcc
    

    输出#2

    Yes
    2 5
    
  • 输入#3

    7 5 3
    aabbaaa
    aaaaa
    

    输出#3

    No
    

说明/提示

In the first sample case you can cut out two substrings starting at 11 and 55 . The resulting string baaaab contains aaaa as a substring.

In the second sample case the resulting string is bccb.

首页