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\le T \le 100 \\ 1 \leq N, X \le 2000\\ \text{S and T are binary strings.}\\ \text{Sum of $N$ over all test cases does not exceed }2000.\)