提示: 欢迎访问OurACM平台。
Problem 1459 binary strings

Accept: 103    Submit: 487
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

There are two binary strings, you task is to change one into another. The only operation you can do is reversing some continual bits of a binary string. For example, after conversing the first four bits of "10101", you change it into "01011".

Input

The first line is an interger T, means the number of test cases. Follows T lines, each line contain two binary strings a and b (they are not longer than 20 bits), you should change a into b.

Output

Output the minimal number you have done to change one into another. You can assume that it always have a solution.

Sample Input

2 1001 0110 10101 01011

Sample Output

2 1

Source

FZU 2006 ICPC Qualification Round I

Submit  Back  Status  Discuss