This question was in one of the online judges(Chinese) and the question was as follows
“Consider you are given two $unequal$ $arrays$ $a$ and $b$ of $integers$ and you need to make the two arrays equal by using following operations. Select a $integer$ (by integer i mean both positive and negative) $x$ and select a $subset$ of $numbers$ from $array$ $a$ and you can $add$ or $multiply$ each $element $ with $x$ and place back them in their previous positions in $array$ $a$ . Find minimum number of operations to make $a=b$“
It was given that $|a|$$<$$6$ and $|a|=|b|$ .
Now when $|a|=1$ then $answer$ will be $0$ or $1$.(it is simple for $|a|=1$)
When $|a|=2$ then worst case answer is $2$ and when they are equal answer is $0$ and if elements have $common$ $difference$ or $common$ $factors$ then answer is $1$.
But i am stuck from case $|a|>2$ for $|a|=3$ the for answer being $0$,$1$ or $3$ i could find ,criteria for answer being $2$ i have no idea and for $|a|>3$ i have no idea how to proceed.
Could anybody give me a hint.( only a hint, i am solving it from $3$ days)
$a=(3,4,5)$ and $b=(10,13,16)$ then answer is $2$ .first multiply whole array with $3$ and then add $1$ to whole array