title: Terminated due timeout in hackerrank
body: <p>My code is in c++
  and currently trying to complete the task . link given below</p>
  
  <p>difficulty level : medium</p>
  
  <p>my algorithm is working fine for 18 out of 20 test cases.
  other 2 are terminated due timeout.</p>
  
  <p>I know what that means but now mam not getting idea to increase the efficiency of my algorithm.</p>
  
  <p>I have given my code below, can anyone PLEASE help me out to tackle this
  <a href="https://www.hackerrank.com/challenges/and-product" rel="nofollow noreferrer">https://www.hackerrank.com/challenges/and-product</a></p>
  
  <pre><code>    #include &lt;cmath&gt;
      #include &lt;cstdio&gt;
      #include &lt;vector&gt;
      #include &lt;iostream&gt;
      #include &lt;algorithm&gt;
      using namespace std;
  
      int main() 
      {
        int t;
        unsigned long int x,y,a;
        cin&gt;&gt;t;
        while(t)
         {       
             cin&gt;&gt;x&gt;&gt;y;
             a=x;
                for(;x&lt;=y;x++)
                  a=a&amp;(x);
  
             cout&lt;&lt;a&lt;&lt;"\n";
             t--;
         }
  
       return 0;
      }
  </code></pre>