foo.cc: In function 'bool check(int, int, int)':
foo.cc:12:10: warning: unused variable 'flag' [-Wunused-variable]
bool flag=1;
^~~~
foo.cc: In function 'int main()':
foo.cc:21:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&m,&n);
~~~~~^~~~~~~~~~~~~~
foo.cc:23:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",orders+i);
~~~~~^~~~~~~~~~~~~~~
foo.cc:26:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&parts[i][j].M);
~~~~~^~~~~~~~~~~~~~~~~~~~~
foo.cc:29:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&parts[i][j].T);
~~~~~^~~~~~~~~~~~~~~~~~~~~