Counting Arrays with divisibility constraint
Given two integers X and Y, the task is to find the number of different arrays that can be constructed of size largest possible size that follow the conditions below:Every element of the array should not be less than X and should not be greater than Y.Every element should occur at most once in the array.Let Ai and Aj be two elements of the array where i is not equal to j, Then Ai should divide Aj or Aj should divide Ai.Note: Two arrays will be considered different if at least one element is present in the first array but…