input: Write a Python function named `count_quality_pairs` that takes two integer lists `array1` and `array2`, along with a positive integer `factor`. This function should return the number of valid pairs (i, j) such that an element in `array1` is divisible by `element * factor` of `array2`. For example:
  
  
  from typing import List
  from collections import defaultdict
  from math import isqrt
  
  def count_quality_pairs(array1: List[int], array2: List[int], factor: int) -> int:
      """
      Returns the count of valid pairs (i, j) where an element in array1 is divisible by the product of a corresponding element and factor in array2.
  
      Example:
      >>> array1 = [1,3,4], array2 = [1,3,4], factor = 1
      5
      >>> array1 = [1,2,4,12], array2 = [2,4], factor = 3
      2
  
      Constraints:
      1 <= len(array1), len(array2) <= 50
      1 <= array1[i], array2[j] <= 50
      1 <= factor <= 50
      """
  
output: def count_quality_pairs(array1, array2, factor):
      count = 0
      for i in array1:
          for j in array2:
              if i % (j * factor) == 0:
                  count += 1
      return count