foo.cc: In function 'int main()':
foo.cc:11:10: warning: unused variable 'k' [-Wunused-variable]
int i,j,k,ans,cnt;
^
foo.cc:11:16: warning: variable 'cnt' set but not used [-Wunused-but-set-variable]
int i,j,k,ans,cnt;
^~~
foo.cc:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&T);
~~~~~^~~~~~~~~
foo.cc:16:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&N);
~~~~~^~~~~~~~~
foo.cc:19:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&a[i]);
~~~~~^~~~~~~~~~~~