foo.c: In function 'main':
foo.c:18:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&m);
^~~~~~~~~~~~~~~~~~~
foo.c:20:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&v[i]);
^~~~~~~~~~~~~~~~~
foo.c:25:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&up[i]);
^~~~~~~~~~~~~~~~~~
foo.c:27:4: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&cost[i][j]);
^~~~~~~~~~~~~~~~~~~~~~~