title: I am writing this C code for a competitive programming platform and would like to know where can I improve the code to overcome SIGTSTP error?
body: <p>The code gives a SIGTSTP error, which seems to be a runtime error.
  I have tried to overcome it and also made a few changes, but it did not work.
  How can I overcome this error and make the code better:</p>
  
  <p>Constraints: 
  <em>1≤T≤100; 
     7≤N≤100; 
     350≤Price[i]≤750</em></p>
  
  <hr>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) 
  {
  long int t,n,good=0,flag=0;
  int j,i,*p;
  scanf("%ld",&amp;t);
  while(t&gt;0)
  {
      scanf("%ld",&amp;n);
      if(n&gt;=7)
      {
         p=(int*)malloc(n*sizeof(int));
         for(i=0;i&lt;n;i++)
              scanf("%ld",&amp;p[i]);
         for(i=1;i&lt;n;i++)
         {
             for(j=1;j&lt;=5;j++)
             {
                 if(i-j &gt; 0)
                 {
                     if (p[i]&lt;p[i-j])
                       flag++;
                 }
             }
             if (flag==i)
               good++;
         }
      }
      printf("%ld",good);
      t--;
  }
  return 0;
  }
  </code></pre>