To (properly) multiply an string by an integer, you split the string into characters, repeat each character a number of times equal to the integer, and then stick the characters back together. If the integer is negative, we use its absolute value in the first step, and then reverse the string. If the input is 0, output nothing (anything multiplied by 0 equals nothing).
Now, you are given the multiplied string and the result of multiplication, and your task is to output the multiplied integer.
You can assume such integer exist. If multiple exist, output any of them.
abc, cba => -1 abc, aabbcc => 2 abc, ccbbaa => -2 aaa, aaaaaa => 2 or -2 (empty), (empty) => any integer aaa, aa => undefined behavior abaa, aaaabbaa => -2 abaa, aabbaaaa => 2 hello, (empty) => 0 a, aaaaaaaaaaa => 11 or -11
This is code-golf, lowest byte count wins!