foo.cc: In function 'int main()':
foo.cc:56:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
mid = l + r >> 1;
~~^~~
foo.cc:43:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &cake[i]);
~~~~~^~~~~~~~~~~~~~~~
foo.cc:47:36: 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", &eat[i]);
~~~~~^~~~~~~~~~~~~~~