blocks.cpp: In function 'bool check(int)':
blocks.cpp:18:6: warning: unused variable 'sum' [-Wunused-variable]
int sum = 0;
^~~
blocks.cpp: At global scope:
blocks.cpp:26:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main()
^
blocks.cpp: In function 'int main()':
blocks.cpp:28:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &n, &k);
~~~~~^~~~~~~~~~~~~~~~~
blocks.cpp:30:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &a[i]), sum += a[i];
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~