String Distance
시간 제한4초메모리 제한512 MB
각 질의마다 A의 부분 문자열과 짧은 문자열 B 전체 사이의 편집 거리를 구한다.
문제
For two strings and , you can do the following operation an arbitrary number of times: Select a string or , insert or delete a character at any position. The distance between two strings and is defined as the minimum number of operations to make and equal.
You will be given two strings and , and also queries.
In each query, you will be given two integers and (). You need to find the distance between the continuous substring and the whole string .
입력
The first line contains a single integer (), the number of test cases. For each test case:
The first line contains a string which consists of () lower-case English letters.
The second line contains a string which consists of () lower-case English letters.
The third line contains a single integer () denoting the number of queries.
Each of the following lines contains two integers and () describing a query.
출력
For each query, print a single line containing an integer denoting the answer.