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