title: Pair With Given Product Set 1 Find If Any Pair Exists
signature: pair_with_given_product_set_1_find_if_any_pair_exists <- function(arr, n, x) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(arr, n, x, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr, n, x), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(10L, 20L, 9L, 40L), 4L, 400L, 
          TRUE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(1L, -10L, 20L, 9L, -40L), 5L, 400L, 
          TRUE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L), 7L, 8L, 
          FALSE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(4L, 10L, 20L, 9L, -40L), 5L, -400L, 
          TRUE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-90L, -86L, -76L, -72L, -70L, -62L, -56L, -50L, -18L, -12L, -10L, 4L, 16L, 26L, 42L, 48L, 52L, 54L, 54L, 70L, 84L, 86L, 88L, 98L), 23L, 23L, 
          FALSE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(1L), 0L, 0L, 
          FALSE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(4L, 7L, 14L, 14L, 16L, 18L, 19L, 20L, 22L, 24L, 29L, 38L, 38L, 38L, 40L, 40L, 46L, 46L, 47L, 51L, 51L, 52L, 55L, 56L, 56L, 62L, 62L, 62L, 78L, 79L, 81L, 84L, 86L, 88L, 89L, 89L, 89L), 23L, 32L, 
          FALSE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(72L, 80L, -82L, 24L, -98L, 90L, -32L, -56L, -22L, 8L, -12L, 8L, -78L, 60L, -62L, 50L, 12L, -60L, 10L, -54L, 74L, 98L, 26L, 56L, 24L), 21L, 19L, 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 22L, 18L, 
          FALSE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(93L, 40L, 48L, 99L, 95L, 59L, 43L, 58L, 79L, 70L, 28L), 9L, 5L, 
          FALSE
      )))
  
  }
  
  main()
source_py: def pair_with_given_product_set_1_find_if_any_pair_exists(arr, n, x):
      for i in arr:
          for j in arr:
              if ((i * j) == x):
                  return True
      return False
source_cpp: bool pair_with_given_product_set_1_find_if_any_pair_exists(vector<int> arr, int n, int x) {
    for ( int i = 0;
    i < n - 1;
    i ++ ) for ( int j = i + 1;
    i < n;
    i ++ ) if ( arr [ i ] * arr [ j ] == x ) return true;
    return false;
  }