segments.cpp:9:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
9 | main() {
| ^
segments.cpp: In function 'int main()':
segments.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
10 | scanf("%lld", &N);
| ~~~~~^~~~~~~~~~~~
segments.cpp:11:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
11 | for (int i = 1; i <= N; i++) scanf("%lld", &presum[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~