title: Finding the count of numbers divisible by either of 3 values. How can it be more optimised
body: <p>Three positive nos. A,B,C.Find no. of pos integers less than D divisible by either a,b,c. Well the test cases ran fine with one but for submitting it needed more optimised code. How can it be more optimised?</p>
  
  <pre><code>solve(int A, int B, int C, int D) {
      int X = 0;
      for (int i = 1; i &lt; D; i++)
      {
          if (i%A==0 || i%B==0 || i%C==0)
          {
              X++;
          }
      }
      return X;
  }
  </code></pre>