garage.cpp: In function 'int main()':
garage.cpp:9:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
int N,M; scanf("%d %d",&N,&M);
~~~~~^~~~~~~~~~~~~~~
garage.cpp:12:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1;i<=N;i++) scanf("%d",&cost[i]);
~~~~~^~~~~~~~~~~~~~~
garage.cpp:13:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1;i<=M;i++) scanf("%d",&weight[i]);
~~~~~^~~~~~~~~~~~~~~~~
garage.cpp:16:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
int t; scanf("%d",&t);
~~~~~^~~~~~~~~