There are two screens which can display sequences of uppercase Latin letters. Initially, both screens display nothing.
In one second, you can do one of the following two actions:
You have to calculate the minimum number of seconds you have to spend so that the first screen displays the sequence $$$s$$$, and the second screen displays the sequence $$$t$$$.
The first line contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of test cases.
Each test case consists of two lines. The first line contains the string $$$s$$$, and the second line contains the string $$$t$$$ ($$$1 \le |s|, |t| \le 100$$$). Both strings consist of uppercase Latin letters.
For each test case, print one integer — the minimum possible number of seconds you have to spend so that the first screen displays the sequence $$$s$$$, and the second screen displays the sequence $$$t$$$.
3GARAGEGARAGEFORSALEABCDEAABCDTRAININGDRAINING
14 10 16
In the first test case, the following sequence of actions is possible:
In the second test case, the following sequence of actions is possible:
In the third test case, the fastest way to display the sequences is to type both of them character by character without copying, and this requires $$$16$$$ seconds.
Name |
---|