Let M(p,q,r,N) be the largest positive integer less than N or equal to N that has only p, q AND r as its distinct prime factors. For example, M(2,3,5,100) will be 90, as 90 = 2 * 3^2 * 5. Note that all prime numbers (p,q and r) should be factors of the number. Find M(3,7,11,1000). I don't know the approach.