You are given two binary strings (where each character is either 0 or 1) S and T, each of length N and an integer X. You can apply the following two types of operations to the string S:
You may perform this operation any number of times. Find the minimum cost to make the strings S and T equal or report that it is impossible.
Input format
Output format
For each test case, print −1 if it is impossible to equalize the strings. Otherwise print the minimum cost to make the strings S and T equal in a separate line.
Constraints
1≤T≤1001≤N,X≤2000S and T are binary strings.Sum of N over all test cases does not exceed 2000.