Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

codechef little chef and numbers

$
0
0
#include<stdio.h>
int main()
{
    long int T,N,A[100001],j,i,t,p,q;

    scanf("%ld",&T);
    while(T--)
    {
    scanf("%ld",&N);
    t=0;
    for(j=0;j<N;j++)
    {
    scanf("%ld",&A[j]);
   p=A[j]*A[j];
    q=A[j]+A[j];
    printf("%d %d",p,q);
    if(p>q)
    {
    t++;
}
 else{

    t=0;
}
}
   printf("%d\n",t);
   }
 return 0;
}

this is the solution of codechef little chef and numbers from march cook 2014.

what is the problem with this answer please tell me soon..


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>