Between Two Sets
Hacker Rank Problem Set "Between Two Sets"
Extract from problem:
Consider two sets of positive integers, A and B. We say that a positive integer, x, is between sets A and B if the following conditions are satisfied:
- All elements in A are factors of x.
- x is a factor of all elements in B.
Given A and B, find and print the number of integers (i.e., possible x's) that are between the two sets.
(Please check on HackerRank for full question)
g++.exe -Wall main.cpp -o main && less data.in | main