시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 1036 476 409 48.982%

문제

먹고또자니 <거기 누구세요> 코너에서는 "돌림판"을 돌려 상품을 얻을 수 있다. 이 돌림판은 큰 원형판이 N등분되어있는 형태이다.

N등분 된 각 부분은 0부터 9사이의 숫자가 하나씩 적혀있다. 게임이 시작되면, 임의의 M자리의 수 X와 Y(X ≤ Y)가 주어진다. (단, 이 수는 0으로 시작될 수도 있다.)
그리고 참가자는 돌림판을 힘차게 돌린다. 힘차게 돌던 돌림판이 완전히 멈추게 되는 순간, 12시 방향의 스피너가 특정 부분을 가리키게 될 것이다. 거기서부터 시계방향으로 M칸 연속되는 수를 읽으면 M자리의 수 Z를 얻을 수 있다.

이 때 얻은 Z가 X ≤ Z ≤ Y를 만족한다면 게임을 승리하고 Z만원을 얻을 수 있다!

The wheel of Numbers

예를 들어, 돌림판이 N = 8 등분되어있고, 시계방향으로 읽었을 때 [3, 7, 8, 3, 1, 9, 2, 7] 과 같다고 하자. X = 200 이고 Y = 311일 경우 "숫자 2"가 적힌 부분부터 시작한다면 Z = 273 으로 X = 200 ≤ 273 ≤ 311 = Y 를 만족하여 게임을 승리한다.

돌림판의 상태와 X, Y가 주어질 때 어느 부분부터 시작하면 게임을 승리할 수 있을 지 알 수 있다. 주어진 조건에 대해서 게임을 승리할 수 있는 가지수를 계산하는 프로그램을 작성하시오.

입력

첫 번째 줄에 테스트케이스의 개수 T가 주어진다.

각 테스트케이스의 첫 줄에는 돌림판을 N등분할 정수 N (1 ≤ N ≤ 100)과 X, Y의 길이 M (1 ≤ M ≤ 9, M ≤ N) 이 주어진다. 그리고 다음 3개의 줄에 X의 각 자리수, Y의 각 자리수, 돌림판의 상태가 주어진다.

X와 Y의 각 자리수는 공백으로 구분되어 0~9사이의 숫자가 한자리씩 주어진다.

돌림판의 상태는 어느 부분부터 시계방향으로 읽었을 때 나타나는 순서대로 주어진다. 돌림판의 숫자도 0~9사이의 숫자가 공백으로 구분되어 주어진다.

출력

각 테스트케이스에 대하여 한 줄씩 정답을 출력한다.

즉, 돌림판에서 X ≤ Z ≤ Y를 만족하는 M자리의 수 Z가 몇 개가 있는 지를 출력한다. 단, 같은 수라도 시작 부분이 다르다면 다른 가지수로 센다. 예를 들어, X와 Y 사이에 있는 수가 123 밖에 없는 데 돌림판에서 2번 나온다면, 1이 아닌 2를 출력한다.

예제 입력 1

3
8 3
2 0 0
3 1 1
3 7 8 3 1 9 2 7
5 2
8 8
9 9
1 3 2 5 4
6 3
0 0 0
9 9 9
1 2 3 4 5 6

예제 출력 1

1
0
6
W3sicHJvYmxlbV9pZCI6IjExNTA0IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHViM2NjXHViODI0IFx1YjNjY1x1YjgyNCBcdWIzY2NcdWI5YmNcdWQzMTAhIiwiZGVzY3JpcHRpb24iOiI8cD5cdWJhMzlcdWFjZTBcdWI2MTBcdWM3OTBcdWIyYzgmbmJzcDsmbHQ7XHVhYzcwXHVhZTMwJm5ic3A7XHViMjA0XHVhZDZjXHVjMTM4XHVjNjk0Jmd0OyBcdWNmNTRcdWIxMDhcdWM1ZDBcdWMxMWNcdWIyOTQgJnF1b3Q7XHViM2NjXHViOWJjXHVkMzEwJnF1b3Q7XHVjNzQ0IFx1YjNjY1x1YjgyNCBcdWMwYzFcdWQ0ODhcdWM3NDQgXHVjNWJiXHVjNzQ0IFx1YzIxOCBcdWM3ODhcdWIyZTQuIFx1Yzc3NCBcdWIzY2NcdWI5YmNcdWQzMTBcdWM3NDAgXHVkMDcwIFx1YzZkMFx1ZDYxNVx1ZDMxMFx1Yzc3NCBOXHViNGYxXHViZDg0XHViNDE4XHVjNWI0XHVjNzg4XHViMjk0IFx1ZDYxNVx1ZDBkY1x1Yzc3NFx1YjJlNC48XC9wPlxyXG5cclxuPHA+Tlx1YjRmMVx1YmQ4NCBcdWI0MWMgXHVhYzAxJm5ic3A7XHViZDgwXHViZDg0XHVjNzQwIDBcdWJkODBcdWQx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