Logo
(追記) (追記ここまで)

19489번 - Neon 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB2910738.889%

문제

Byteasar is a well known Byteotian prankster -- he earns a living arranging various funny situations, which he then documents in the form of videos posted on the internet. This time he has targeted a huge neon sign on the roof of a prestigious hotel with a very long name.

The neon sign $w$ displaying the name of the hotel, contains $n$ letters. Byteasar intends to break in onto the hotel roof during the night to switch off some of the neon letters so that remaining letters, read from left to right, comprise some very funny, $m$-letter word $s$. In order to obtain an attractive effect, the position of the last lit letter and the first lit letter must not differ by less than $k$. The prankster wonders what is the number of ways he can switch off some of the letters in order to achieve his goal.

Formally, he is interested in the number of ways in which it is possible to choose indices $j_1,j_2,\ldots,j_m$ from the range $[1,n],ドル so that $j_1<j_2<\ldots<j_m,ドル $j_m-j_1\geq k$ and $w_{j_1}w_{j_2}\ldots w_{j_m}=s,ドル where $w_i$ denotes $i$-th letter of the string $w$. The indices $j_1,j_2,\ldots,j_m$ correspond to the positions of letters which will remain lit.

입력

The first line of the input contains three integers $n,ドル $m,ドル $k$ (1ドル\leq k\leq n\leq 100,000円,ドル 1ドル\leq m\leq 10$). The second line contains an $n$-letter word $w$ displayed on the hotel's roof. The third line contains an $m$-letter word $s$ to be displayed after switching off some of letters. Words $w$ and $s$ consist solely of lower-case letters of the English alphabet $(a-z)$.

출력

The only line of the output should contain the sought number of ways Byteasar can achieve his goal, modulo 10ドル^9+7$.

제한

예제 입력 1

13 3 5
longlonghotel
lol

예제 출력 1

5

힌트

In the example, Byteasar can leave the lit letters on one of the following position sets: $\{1,2,13\},ドル $\{1,6,13\},ドル $\{1,10,13\},ドル $\{5,6,13\},ドル $\{5,10,13\}$.

출처

Camp > Petrozavodsk Programming Camp > Summer 2016 > Day 6: Warsaw U Contest, XVI Open Cup Onsite E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /